From 82ab56668b6485fbd978801f47d5fbdf238de320 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 28 Nov 2021 05:13:48 +0000 Subject: [PATCH] Convert - to . during username generation --- apiserver/generate_users.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apiserver/generate_users.py b/apiserver/generate_users.py index 90866e3..e527217 100755 --- a/apiserver/generate_users.py +++ b/apiserver/generate_users.py @@ -36,14 +36,14 @@ for member in members: if not member.last_name.isalpha(): print(' Non-alpha last name.') - first_name = member.first_name.lower() - last_name = member.last_name.lower() + first_name = member.first_name.strip().lower() + last_name = member.last_name.strip().lower() - first_name = re.sub(r'[^a-z ]+', '', first_name) - last_name = re.sub(r'[^a-z ]+', '', last_name) + first_name = re.sub(r'[^a-z- ]+', '', first_name) + last_name = re.sub(r'[^a-z- ]+', '', last_name) - first_name = first_name.replace(' ', '.') - last_name = last_name.replace(' ', '.') + first_name = first_name.replace(' ', '.').replace('-', '.') + last_name = last_name.replace(' ', '.').replace('-', '.') username = first_name + '.' + last_name print(' Username:', username)