fix(permissions): restrict deletes and admin member management

This commit is contained in:
2026-04-28 10:02:37 +03:30
parent 02c9c17c30
commit afb1a55570
9 changed files with 157 additions and 37 deletions

View File

@@ -26,13 +26,15 @@ def create_project(user, workspace, name, client=None, description="", color="")
if Project.objects.filter(workspace=workspace, name=name, is_deleted=False).exists():
raise ValidationError({"name": "A project with this name already exists in the workspace."})
project = Project.objects.create(
workspace=workspace,
name=name,
client=client,
description=description,
color=color
)
project = Project.objects.create(
workspace=workspace,
name=name,
client=client,
description=description,
color=color,
created_by=user,
updated_by=user,
)
ProjectMembership.objects.create(
project=project,