Skip to content

Commit

Permalink
Merge pull request #49 from AI4Bharat/add/user
Browse files Browse the repository at this point in the history
feature for adding user back to the projects he was earlier part of a…
  • Loading branch information
ishvindersethi22 authored Apr 1, 2024
2 parents 3a68bb3 + 33e47d4 commit 3f03fa0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backend/workspaces/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3135,8 +3135,16 @@ def remove_frozen_user(self, request, pk=None):
if user in workspace.frozen_users.all():
workspace.frozen_users.remove(user)
workspace.save()

projects = Project.objects.filter(workspace_id=pk)
for project in projects:
if user in project.frozen_users.all():
project.frozen_users.remove(user)
project.save()
return Response(
{"message": "Frozen User removed from the workspace"},
{
"message": "Frozen User removed from the workspace and workspace projects"
},
status=status.HTTP_200_OK,
)
else:
Expand Down

0 comments on commit 3f03fa0

Please sign in to comment.