Commit dde79105 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Change the update process of the userinfo

parent ac367a14
...@@ -293,10 +293,8 @@ class User(AbstractUser): ...@@ -293,10 +293,8 @@ class User(AbstractUser):
return Exception('Two user instances with same subject from the same idp') return Exception('Two user instances with same subject from the same idp')
user = query.first() user = query.first()
# update the users userinfo user.update_userinfo(userinfo)
user.userinfo = userinfo
user.save() user.save()
return user return user
@classmethod @classmethod
...@@ -309,6 +307,7 @@ class User(AbstractUser): ...@@ -309,6 +307,7 @@ class User(AbstractUser):
if 'email' not in userinfo: if 'email' not in userinfo:
username = sub username = sub
email = ''
else: else:
username = userinfo['email'] username = userinfo['email']
email = userinfo['email'] email = userinfo['email']
...@@ -319,15 +318,10 @@ class User(AbstractUser): ...@@ -319,15 +318,10 @@ class User(AbstractUser):
sub=sub, sub=sub,
email=email, email=email,
idp=idp, idp=idp,
userinfo=userinfo,
) )
user.update_userinfo(userinfo)
user.save() user.save()
for group in idp.get_user_groupinformation(
userinfo,
).all():
group.users.add(user)
return user return user
@classmethod @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