Commit dde79105 authored by Lukas Burgey's avatar Lukas Burgey

Change the update process of the userinfo

parent ac367a14
......@@ -293,10 +293,8 @@ class User(AbstractUser):
return Exception('Two user instances with same subject from the same idp')
user = query.first()
# update the users userinfo
user.userinfo = userinfo
user.update_userinfo(userinfo)
user.save()
return user
@classmethod
......@@ -309,6 +307,7 @@ class User(AbstractUser):
if 'email' not in userinfo:
username = sub
email = ''
else:
username = userinfo['email']
email = userinfo['email']
......@@ -319,15 +318,10 @@ class User(AbstractUser):
sub=sub,
email=email,
idp=idp,
userinfo=userinfo,
)
user.update_userinfo(userinfo)
user.save()
for group in idp.get_user_groupinformation(
userinfo,
).all():
group.users.add(user)
return user
@classmethod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment