mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Fix issue when the enterprise_auth has already been created
This commit is contained in:
parent
723449818d
commit
e9e027ecd7
@ -136,8 +136,9 @@ class LDAPBackend(BaseLDAPBackend):
|
||||
def _decorate_enterprise_user(user, provider):
|
||||
user.set_unusable_password()
|
||||
user.save()
|
||||
enterprise_auth = UserEnterpriseAuth(user=user, provider=provider)
|
||||
enterprise_auth.save()
|
||||
enterprise_auth, created = UserEnterpriseAuth.objects.get_or_create(user=user, provider=provider)
|
||||
if created:
|
||||
enterprise_auth.save()
|
||||
return enterprise_auth
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user