remove user and their lists from group when group.user blocks them

Lists are changed to closed curation with no group.
This commit is contained in:
Hugh Rundle 2021-10-09 22:13:12 +11:00
parent 9940abfd81
commit b3cc9e5b75

View file

@ -23,6 +23,10 @@ class Block(View):
models.UserBlocks.objects.create(
user_subject=request.user, user_object=to_block
)
# remove the blocked users's lists from the groups
models.List.remove_from_group(request.user, to_block)
# remove the blocked user from all blocker's owned groups
models.GroupMember.remove(request.user, to_block)
return redirect("prefs-block")