fix(permissions): restrict deletes and admin member management
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user