From 04d3c194d80ae4be4afffd92fefeef986410e93a Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 28 Aug 2024 18:52:32 +0000 Subject: [PATCH] refactor: add user to group instead of group to user no functional change, just improving readability --- benefits/core/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benefits/core/admin.py b/benefits/core/admin.py index f7abc1edc..a21f8128c 100644 --- a/benefits/core/admin.py +++ b/benefits/core/admin.py @@ -151,7 +151,7 @@ def add_google_sso_userinfo(user, request): def add_staff_user_to_group(user, request): if user.email in settings.GOOGLE_SSO_STAFF_LIST: staff_group = Group.objects.get(name=settings.STAFF_GROUP_NAME) - user.groups.add(staff_group) + staff_group.user_set.add(user) def add_transit_agency_staff_user_to_group(user, request): @@ -159,4 +159,4 @@ def add_transit_agency_staff_user_to_group(user, request): if user_sso_domain: agency = models.TransitAgency.objects.filter(sso_domain=user_sso_domain).first() if agency is not None and agency.staff_group: - user.groups.add(agency.staff_group) + agency.staff_group.user_set.add(user)