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

Apply email, first, and last name to the models.User instances

parent 50a9d56a
...@@ -224,8 +224,14 @@ class User(AbstractUser): ...@@ -224,8 +224,14 @@ class User(AbstractUser):
dep.user_remove() dep.user_remove()
def update_userinfo(self, userinfo): def update_userinfo(self, userinfo):
if 'sub' not in userinfo: if 'email' in userinfo:
raise Exception('Missing attribute in userinfo: sub') = userinfo['email']
if 'family_name' in userinfo:
self.last_name = userinfo['family_name']
if 'given_name' in userinfo:
self.first_name = userinfo['given_name']
self.userinfo = userinfo self.userinfo = userinfo
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