diff --git a/projects/views.py b/projects/views.py index 4fede886..dbb3b546 100644 --- a/projects/views.py +++ b/projects/views.py @@ -543,7 +543,11 @@ def delete(self, request, project_pk: int) -> Response: project_id=project_pk, user_id=current_user_id, ) - project = Project.objects.get(id=project_pk).select_related("leader") + project = ( + Project.objects.select_related("leader") + .get(id=project_pk) + .select_related("leader") + ) if project.leader.id == current_user_id: return Response( {