1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +03:00

manually merged

This commit is contained in:
Adolfo Gómez García 2023-01-16 12:30:55 +01:00
parent 688c0e7630
commit dc4ecc5940
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -250,6 +250,11 @@ class Authenticators(ModelHandler):
fields['mfa_id'] = None
# If label has spaces, replace them with underscores
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']):
raise self.invalidRequestException(
_('Label must contain only letters, numbers, ":" and "-"')
)
def deleteItem(self, item: Authenticator):
# For every user, remove assigned services (mark them for removal)