aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Roman2019-10-07 18:29:17 +0300
committerTudor Roman2019-10-07 18:29:17 +0300
commit598a52845e9ba19705e8f26ece6f5fcf0775f9e5 (patch)
treef86f5b45a3ef14820f2ee5803ee9c7ea076c54e4
parent804861ea75aa101c6b49d1a467c5835ad9800b98 (diff)
downloadrmi_scripts-598a52845e9ba19705e8f26ece6f5fcf0775f9e5.tar.gz
rmi_scripts-598a52845e9ba19705e8f26ece6f5fcf0775f9e5.zip
2019
-rwxr-xr-xadd_users9
1 files changed, 4 insertions, 5 deletions
diff --git a/add_users b/add_users
index 3992b8e..81133c6 100755
--- a/add_users
+++ b/add_users
@@ -29,12 +29,11 @@ users = []
with open(sys.argv[1]) as in_file:
reader = csv.DictReader(in_file, delimiter=',')
for row in reader:
- name = row['name'].split(' ')
- first_name = to_ascii(' '.join(name[0:-1]))
- last_name = to_ascii(name[-1])
- username = (last_name + '-' + binascii.b2a_hex(os.urandom(15))[-3:].decode('ascii')).lower()
+ first_name = row['Prenume']
+ last_name = row['Nume']
+ username = (to_ascii(last_name) + '-' + binascii.b2a_hex(os.urandom(15))[-3:].decode('ascii')).lower()
password = binascii.b2a_hex(os.urandom(6)).decode('ascii')
- users.append(User(first_name, last_name, username, password, row['id']))
+ users.append(User(first_name, last_name, username, password, row['team_id']))
with open(sys.argv[2], 'w') as out_file:
writer = csv.writer(out_file)
writer.writerow(['first_name', 'last_name', 'username', 'password', 'team_id'])