hobo_notify: search role only by uuid, not name (#35158)
This commit is contained in:
parent
a2452f875c
commit
db3d4870c1
|
@ -534,6 +534,11 @@ def test_process_notification_user_provision(pub):
|
|||
u'name': u'Service état civil',
|
||||
u'description': u'etc.',
|
||||
},
|
||||
{
|
||||
u'uuid': u'unknown-uuid',
|
||||
u'name': u'Service enfance',
|
||||
u'description': u'',
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
|
|
|
@ -190,7 +190,7 @@ class CmdHoboNotify(Command):
|
|||
user.is_admin = o.get('is_superuser', False)
|
||||
user.roles = []
|
||||
for role_ref in o.get('roles', []):
|
||||
role = Role.resolve(role_ref['uuid'], name=role_ref.get('name'))
|
||||
role = Role.resolve(role_ref['uuid'])
|
||||
if role and role.id not in user.roles:
|
||||
user.add_roles([role.id])
|
||||
user.set_attributes_from_formdata(user.form_data)
|
||||
|
|
Loading…
Reference in New Issue