agent/authentic2: fix provisionning of attributes when an attribute is disabled (#22751)
Attribute.objects.get_or_create() can fail on an existing attribute as the default "objects" manager of the Attribute model hide disabled attributes, so the get() can fail but won't be able to create the attribute.
This commit is contained in:
parent
79da1603bd
commit
411e94363a
|
@ -68,7 +68,7 @@ class Command(hobo_deploy.Command):
|
|||
# so it gets shared as SAML attribute.
|
||||
fields.append(attribute['name'])
|
||||
continue
|
||||
attr, created = Attribute.objects.get_or_create(
|
||||
attr, created = Attribute.all_objects.get_or_create(
|
||||
name=attribute['name'],
|
||||
defaults={'kind': attribute['kind']})
|
||||
for key in ('label', 'description', 'asked_on_registration',
|
||||
|
|
Loading…
Reference in New Issue