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
4fa25981
Commit
4fa25981
authored
Nov 23, 2018
by
Lukas Burgey
Browse files
Fix a bug in the userinfo updating
parent
4780bd9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/models/users.py
View file @
4fa25981
...
...
@@ -268,23 +268,24 @@ class User(AbstractUser):
LOGGER
.
info
(
self
.
msg
(
'New: %s'
),
ent
)
self
.
vos
.
add
(
ent
)
self
.
user_changed_vo_added
(
loc_
ent
)
self
.
user_changed_vo_added
(
ent
)
def
update_userinfo_groups
(
self
,
userinfo
):
if
self
.
idp
.
userinfo_field_groups
is
None
:
return
groups
=
userinfo
.
get
(
self
.
idp
.
userinfo_field_groups
,
[])
local_groups
=
self
.
vos
.
instance_of
(
Group
)
remote_groups
=
userinfo
.
get
(
self
.
idp
.
userinfo_field_groups
,
[])
# check if groups were removed
for
group
in
self
.
vos
.
instance_of
(
G
roup
)
:
if
group
.
name
not
in
groups
:
for
group
in
local_g
roup
s
:
if
group
.
name
not
in
remote_
groups
:
self
.
vos
.
remove
(
group
)
self
.
user_changed_vo_removed
(
group
)
# check if groups were added
for
group_name
in
groups
:
for
group_name
in
remote_
groups
:
group
=
Group
.
get_group
(
name
=
group_name
,
idp
=
self
.
idp
)
# check if user needs to be in this group
...
...
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