Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JobDoesburg committed Apr 2, 2024
1 parent d90558f commit c1a66c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion website/users/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
@receiver(post_save, sender=GroupSettings)
def after_group_change(sender, instance, **kwargs):
"""Update the is_staff value of all users when possibly the gets_staff_permission field has changed."""
for user in instance.group.user_set.all():
try:
users = instance.group.user_set.all()
except Group.DoesNotExist:
return

for user in users:
update_staff_status(user)


Expand Down

0 comments on commit c1a66c5

Please sign in to comment.