authentic agent: do not alter type of attributes (#22437)

This commit is contained in:
Frédéric Péters 2018-03-09 21:51:33 +01:00
parent 3491269db8
commit 93eacef399
1 changed files with 4 additions and 2 deletions

View File

@ -68,9 +68,11 @@ class Command(hobo_deploy.Command):
# so it gets shared as SAML attribute.
fields.append(attribute['name'])
continue
attr, created = Attribute.objects.get_or_create(name=attribute['name'])
attr, created = Attribute.objects.get_or_create(
name=attribute['name'],
defaults={'kind': attribute['kind']})
for key in ('label', 'description', 'asked_on_registration',
'user_editable', 'user_visible', 'kind', 'required'):
'user_editable', 'user_visible', 'required'):
setattr(attr, key, attribute[key])
if attribute['disabled']:
# don't actively remove attribute, just make sure it never