diff --git a/ligoauth/middleware/auth.py b/ligoauth/middleware/auth.py index cc22d966d59a9b27fce1086a00ebbfb27a874743..196b1ab3431533d03b4c202c180109f1be3f4721 100644 --- a/ligoauth/middleware/auth.py +++ b/ligoauth/middleware/auth.py @@ -133,6 +133,8 @@ class LigoAuthMiddleware: pass # If the user has lost a group membership, remove it. for group_name in stored_user_group_names - user_group_names: + if group_name in settings.ADMIN_MANAGED_GROUPS: + continue try: g = Group.objects.get(name=group_name) g.user_set.remove(user) diff --git a/settings/default.py b/settings/default.py index 9da88af8fcc2afa7bb27f3db41864f1540d973ed..809fafb3e5a65a1fa39fa2f3df0239d768f90f8a 100644 --- a/settings/default.py +++ b/settings/default.py @@ -60,6 +60,8 @@ VOEVENT_FAR_FLOOR = 3.17e-10 # EM Advocate Group name EM_ADVOCATE_GROUP = 'em_advocates' +ADMIN_MANAGED_GROUPS = [EM_ADVOCATE_GROUP, 'executives',] + # 11/18/14. No longer checking XMPP_ALERT_CHANNELS. This is not necessary. # If someone sends out an event, an alert should go out. Listerers have the # option to unsubscribe from nodes if so desired.