[WEB - 1835] chore: update workspace constants (#5017)
* dev: add workspace restriction list in constants * dev: update list
This commit is contained in:
parent
fc33238d89
commit
3dc933f0e8
2 changed files with 32 additions and 14 deletions
|
|
@ -15,6 +15,7 @@ from plane.db.models import (
|
||||||
WorkspaceTheme,
|
WorkspaceTheme,
|
||||||
WorkspaceUserProperties,
|
WorkspaceUserProperties,
|
||||||
)
|
)
|
||||||
|
from plane.utils.constants import RESTRICTED_WORKSPACE_SLUGS
|
||||||
|
|
||||||
|
|
||||||
class WorkSpaceSerializer(DynamicBaseSerializer):
|
class WorkSpaceSerializer(DynamicBaseSerializer):
|
||||||
|
|
@ -23,20 +24,7 @@ class WorkSpaceSerializer(DynamicBaseSerializer):
|
||||||
total_issues = serializers.IntegerField(read_only=True)
|
total_issues = serializers.IntegerField(read_only=True)
|
||||||
|
|
||||||
def validated(self, data):
|
def validated(self, data):
|
||||||
if data.get("slug") in [
|
if data.get("slug") in RESTRICTED_WORKSPACE_SLUGS:
|
||||||
"404",
|
|
||||||
"accounts",
|
|
||||||
"api",
|
|
||||||
"create-workspace",
|
|
||||||
"god-mode",
|
|
||||||
"installations",
|
|
||||||
"invitations",
|
|
||||||
"onboarding",
|
|
||||||
"profile",
|
|
||||||
"spaces",
|
|
||||||
"workspace-invitations",
|
|
||||||
"password",
|
|
||||||
]:
|
|
||||||
raise serializers.ValidationError({"slug": "Slug is not valid"})
|
raise serializers.ValidationError({"slug": "Slug is not valid"})
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
||||||
30
apiserver/plane/utils/constants.py
Normal file
30
apiserver/plane/utils/constants.py
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
RESTRICTED_WORKSPACE_SLUGS = [
|
||||||
|
"404",
|
||||||
|
"accounts",
|
||||||
|
"api",
|
||||||
|
"create-workspace",
|
||||||
|
"god-mode",
|
||||||
|
"installations",
|
||||||
|
"invitations",
|
||||||
|
"onboarding",
|
||||||
|
"profile",
|
||||||
|
"spaces",
|
||||||
|
"workspace-invitations",
|
||||||
|
"password",
|
||||||
|
"flags",
|
||||||
|
"monitor",
|
||||||
|
"monitoring",
|
||||||
|
"ingest",
|
||||||
|
"plane-pro",
|
||||||
|
"plane-ultimate",
|
||||||
|
"enterprise",
|
||||||
|
"plane-enterprise",
|
||||||
|
"disco",
|
||||||
|
"silo",
|
||||||
|
"chat",
|
||||||
|
"calendar",
|
||||||
|
"drive",
|
||||||
|
"channels",
|
||||||
|
"upgrade",
|
||||||
|
"billing",
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue