diff --git a/website/users/signals.py b/website/users/signals.py index 78aaae84..7f11b827 100644 --- a/website/users/signals.py +++ b/website/users/signals.py @@ -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)