Skip to content

Commit

Permalink
fixed signal receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani committed Nov 6, 2024
1 parent 3e2c6e2 commit 7d42439
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tdrs-backend/tdpservice/users/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
@receiver(m2m_changed, sender=User.groups.through)
def user_group_changed(sender, instance, action, pk_set, **kwargs):
"""Send an email to the System Owner when a user is assigned or removed from the System Admin role."""
if pk_set:
ADMIN_GROUP_PK = Group.objects.get(name="OFA System Admin").pk
ACTIONS = {
ACTIONS = {
'PRE_REMOVE': 'pre_remove',
'PRE_ADD': 'pre_add',
'PRE_CLEAR': 'pre_clear'
}
if pk_set:
ADMIN_GROUP_PK = Group.objects.get(name="OFA System Admin").pk
group_change_list = [pk for pk in pk_set]
if ADMIN_GROUP_PK in group_change_list and action == ACTIONS['PRE_ADD']:
# EMAIL ADMIN GROUP ADDED to OFA ADMIN
Expand Down

0 comments on commit 7d42439

Please sign in to comment.