Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
b1ca8603
Commit
b1ca8603
authored
Oct 22, 2018
by
Lukas Burgey
Browse files
Apply email, first, and last name to the models.User instances
parent
50a9d56a
Changes
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/models/users.py
View file @
b1ca8603
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment