Skip to content

Commit f45927b

Browse files
committed
fixed leave
1 parent c08780f commit f45927b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

projects/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,11 @@ def delete(self, request, project_pk: int) -> Response:
510510
project_id=project_pk,
511511
user_id=current_user_id,
512512
)
513-
project = Project.objects.get(id=project_pk).select_related("leader")
513+
project = (
514+
Project.objects.select_related("leader")
515+
.get(id=project_pk)
516+
.select_related("leader")
517+
)
514518
if project.leader.id == current_user_id:
515519
return Response(
516520
{

0 commit comments

Comments
 (0)