1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-08-25 13:49:59 +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

View File

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