mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 00:37:37 -02:30
Merge pull request #4396 from ryanpetrello/ldap-audit
properly set `is_system_auditor` on initial LDAP login Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -122,7 +122,11 @@ def user_is_system_auditor(user):
|
|||||||
|
|
||||||
@user_is_system_auditor.setter
|
@user_is_system_auditor.setter
|
||||||
def user_is_system_auditor(user, tf):
|
def user_is_system_auditor(user, tf):
|
||||||
if user.id:
|
if not user.id:
|
||||||
|
# If the user doesn't have a primary key yet (i.e., this is the *first*
|
||||||
|
# time they've logged in, and we've just created the new User in this
|
||||||
|
# request), we need one to set up the system auditor role
|
||||||
|
user.save()
|
||||||
if tf:
|
if tf:
|
||||||
role = Role.singleton('system_auditor')
|
role = Role.singleton('system_auditor')
|
||||||
# must check if member to not duplicate activity stream
|
# must check if member to not duplicate activity stream
|
||||||
|
|||||||
Reference in New Issue
Block a user