1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-13 08:58:35 +03:00

small auth rest fix

This commit is contained in:
Adolfo Gómez García 2023-02-20 18:21:07 +01:00
parent 5907985719
commit 9192a0a822
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -221,11 +221,11 @@ class Authenticators(ModelHandler):
uuid=processUuid(fields['mfa_id'])
)
fields['mfa_id'] = mfa.id
return
except MFA.DoesNotExist:
pass # will set field to null
else:
fields['mfa_id'] = None
fields['mfa_id'] = None
fields['small_name'] = fields['small_name'].strip().replace(' ', '-')
# And ensure small_name chars are valid [ a-zA-Z0-9:-]+
if fields['small_name'] and not re.match(r'^[a-zA-Z0-9:-]+$', fields['small_name']):