mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
10 lines
292 B
Python
10 lines
292 B
Python
from social_core.storage import NO_ASCII_REGEX, NO_SPECIAL_REGEX
|
|
|
|
|
|
def clean_username(value):
|
|
"""Clean username removing any unsupported character"""
|
|
value = NO_ASCII_REGEX.sub('', value)
|
|
value = NO_SPECIAL_REGEX.sub('', value)
|
|
value = value.replace(':', '')
|
|
return value
|