feat(api): removed unsupported symbols from Google account's name
This commit is contained in:
parent
e081fdc446
commit
a9c2356f79
2 changed files with 9 additions and 1 deletions
|
|
@ -176,6 +176,11 @@ def is_alphabet_space_dash(word):
|
|||
return r.match(word) is not None
|
||||
|
||||
|
||||
def remove_non_alphabet_space_dash(word):
|
||||
r = re.compile("[^a-zA-Z -]")
|
||||
return r.sub('', word)
|
||||
|
||||
|
||||
def merge_lists_by_key(l1, l2, key):
|
||||
merged = {}
|
||||
for item in l1 + l2:
|
||||
|
|
|
|||
|
|
@ -140,7 +140,10 @@ async def create_oauth_tenant(fullname: str, email: str):
|
|||
errors.append("Email address previously deleted.")
|
||||
|
||||
if fullname is None or len(fullname) < 1 or not helper.is_alphabet_space_dash(fullname):
|
||||
errors.append("Invalid full name.")
|
||||
edited_fullname = helper.remove_non_alphabet_space_dash(fullname)
|
||||
if len(edited_fullname) < 1:
|
||||
errors.append("Invalid full name.")
|
||||
fullname = edited_fullname
|
||||
|
||||
if len(errors) > 0:
|
||||
logger.warning(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue