Skip to content

Commit

Permalink
Add logging and change group name
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-linaro committed Jan 15, 2024
1 parent eb8a14a commit a640c50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transition_user_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ def create(ticket_data):
""" Create handler. """
# Start by making sure that the requester is in IT or HR.
email_address = shared_sd.reporter_email_address(ticket_data)
print(f"transition_user_account: reporter email address = {email_address}")
account_dn = shared_ldap.find_from_email(email_address)
print(f"transition_user_account: account DN = {account_dn}")
valid_account = shared_ldap.is_dn_in_group("hr", account_dn) or \
shared_ldap.is_dn_in_group("it-services", account_dn)
shared_ldap.is_dn_in_group("its", account_dn)
if not valid_account:
shared_sd.post_comment(
"You must be in HR or IT Services to use this request.",
Expand Down

0 comments on commit a640c50

Please sign in to comment.