fix: workspace slug validation (#5023)
This commit is contained in:
parent
db722d580f
commit
095639b976
3 changed files with 13 additions and 18 deletions
|
|
@ -5,6 +5,7 @@ from django.db import models
|
|||
|
||||
# Module imports
|
||||
from .base import BaseModel
|
||||
from plane.utils.constants import RESTRICTED_WORKSPACE_SLUGS
|
||||
|
||||
ROLE_CHOICES = (
|
||||
(20, "Owner"),
|
||||
|
|
@ -112,19 +113,7 @@ def get_issue_props():
|
|||
|
||||
|
||||
def slug_validator(value):
|
||||
if value in [
|
||||
"404",
|
||||
"accounts",
|
||||
"api",
|
||||
"create-workspace",
|
||||
"god-mode",
|
||||
"installations",
|
||||
"invitations",
|
||||
"onboarding",
|
||||
"profile",
|
||||
"spaces",
|
||||
"workspace-invitations",
|
||||
]:
|
||||
if value in RESTRICTED_WORKSPACE_SLUGS:
|
||||
raise ValidationError("Slug is not valid")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue