fix: workspace slug validation (#5023)

This commit is contained in:
Nikhil 2024-07-03 13:19:57 +05:30 committed by GitHub
parent db722d580f
commit 095639b976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 18 deletions

View file

@ -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")