1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-11 05:17:55 +03:00

fixed label and autenticator labels to replace spaces by underscores

This commit is contained in:
Adolfo Gómez García 2022-12-13 13:43:08 +01:00
parent 6081122311
commit c208814dd0
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 4 additions and 0 deletions

View File

@ -225,6 +225,8 @@ class Authenticators(ModelHandler):
pass # will set field to null
fields['mfa_id'] = None
# If label has spaces, replace them with underscores
fields['small_name'] = fields['small_name'].strip().replace(' ', '_')

View File

@ -199,6 +199,8 @@ class Transports(ModelHandler):
def beforeSave(self, fields: typing.Dict[str, typing.Any]) -> None:
fields['allowed_oss'] = ','.join(fields['allowed_oss'])
# If label has spaces, replace them with underscores
fields['label'] = fields['label'].strip().replace(' ', '_')
def afterSave(self, item: Transport) -> None:
try: