feat(accounts): Copy distant attributes
This commit is contained in:
parent
e31731f8e6
commit
5ec6a482cc
1 changed files with 7 additions and 1 deletions
|
@ -41,7 +41,13 @@ class SharedAccountAdapter(DefaultSocialAccountAdapter):
|
|||
user = User.objects.get(username=username)
|
||||
sociallogin.connect(request, user)
|
||||
except User.DoesNotExist:
|
||||
pass
|
||||
return
|
||||
|
||||
# We now know that a user exists, copy the distant attributes
|
||||
user.is_staff = user.is_admin
|
||||
user.is_superuser = user.is_admin
|
||||
|
||||
user.save()
|
||||
|
||||
def populate_user(self, request, sociallogin, data):
|
||||
return super().populate_user(request, sociallogin, data)
|
||||
|
|
Loading…
Add table
Reference in a new issue