[WEB-2092] fix: added unique constraints for project, module and states (#5281)
* fix: added unique constraints * chore: migration indetaton
This commit is contained in:
parent
67f2e2fdb2
commit
daaa04c6ea
17 changed files with 160 additions and 14 deletions
|
|
@ -40,6 +40,7 @@ class CycleSerializer(BaseSerializer):
|
|||
"workspace",
|
||||
"project",
|
||||
"owned_by",
|
||||
"deleted_at",
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class ModuleSerializer(BaseSerializer):
|
|||
"updated_by",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"deleted_at",
|
||||
]
|
||||
|
||||
def to_representation(self, instance):
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class ProjectSerializer(BaseSerializer):
|
|||
"updated_at",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"deleted_at",
|
||||
]
|
||||
|
||||
def validate(self, data):
|
||||
|
|
|
|||
|
|
@ -404,6 +404,10 @@ class CycleAPIEndpoint(BaseAPIView):
|
|||
)
|
||||
# Delete the cycle
|
||||
cycle.delete()
|
||||
# Delete the cycle issues
|
||||
CycleIssue.objects.filter(
|
||||
cycle_id=self.kwargs.get("pk"),
|
||||
).delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -301,6 +301,10 @@ class ModuleAPIEndpoint(BaseAPIView):
|
|||
epoch=int(timezone.now().timestamp()),
|
||||
)
|
||||
module.delete()
|
||||
# Delete the module issues
|
||||
ModuleIssue.objects.filter(
|
||||
module=pk,
|
||||
).delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue