Strip whitespace during import

This commit is contained in:
Ramon Wenger 2019-07-15 14:48:28 +02:00
parent 780d72f3b9
commit 87b66336e6
1 changed files with 3 additions and 3 deletions

View File

@ -20,10 +20,10 @@ class Command(BaseCommand):
with open(abs_path) as f: with open(abs_path) as f:
reader = csv.DictReader(f) reader = csv.DictReader(f)
for row in reader: for row in reader:
email = row['Email'].lower() email = row['Email'].lower().strip()
school_class_names = [c.strip() for c in row['Klassen'].split(',')] school_class_names = [c.strip() for c in row['Klassen'].split(',')]
first_name = row['Vorname'] first_name = row['Vorname'].strip()
last_name = row['Nachname'] last_name = row['Nachname'].strip()
self.stdout.write("Creating user {} {}, {}".format(first_name, last_name, email)) self.stdout.write("Creating user {} {}, {}".format(first_name, last_name, email))