Commit b1ca8603 authored by Lukas Burgey's avatar Lukas Burgey

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

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