feat: user preference url and sort order change (#6505)
* fix: change url * Change order of user preference keys
This commit is contained in:
parent
58a4ca9f36
commit
8f5ce6b232
3 changed files with 9 additions and 5 deletions
|
|
@ -261,12 +261,12 @@ urlpatterns = [
|
|||
),
|
||||
# User Preference
|
||||
path(
|
||||
"workspaces/<str:slug>/user-preferences/",
|
||||
"workspaces/<str:slug>/sidebar-preferences/",
|
||||
WorkspaceUserPreferenceViewSet.as_view(),
|
||||
name="workspace-user-preference",
|
||||
),
|
||||
path(
|
||||
"workspaces/<str:slug>/user-preferences/<str:key>/",
|
||||
"workspaces/<str:slug>/sidebar-preferences/<str:key>/",
|
||||
WorkspaceUserPreferenceViewSet.as_view(),
|
||||
name="workspace-user-preference",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -27,7 +27,11 @@ class WorkspaceUserPreferenceViewSet(BaseAPIView):
|
|||
|
||||
create_preference_keys = []
|
||||
|
||||
keys = [key for key, _ in WorkspaceUserPreference.UserPreferenceKeys.choices]
|
||||
keys = [
|
||||
key
|
||||
for key, _ in WorkspaceUserPreference.UserPreferenceKeys.choices
|
||||
if key not in ["projects"]
|
||||
]
|
||||
|
||||
for preference in keys:
|
||||
if preference not in get_preference.values_list("key", flat=True):
|
||||
|
|
|
|||
|
|
@ -392,10 +392,10 @@ class WorkspaceUserPreference(BaseModel):
|
|||
"""Preference for the workspace for a user"""
|
||||
|
||||
class UserPreferenceKeys(models.TextChoices):
|
||||
PROJECTS = "projects", "Projects"
|
||||
ANALYTICS = "analytics", "Analytics"
|
||||
CYCLES = "cycles", "Cycles"
|
||||
VIEWS = "views", "Views"
|
||||
ANALYTICS = "analytics", "Analytics"
|
||||
PROJECTS = "projects", "Projects"
|
||||
|
||||
workspace = models.ForeignKey(
|
||||
"db.Workspace",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue