FIX: use "Amtlicher Vorname" if given

This commit is contained in:
Dominik Rimpf 2022-10-29 18:47:05 +02:00
parent 0eace931c2
commit 409142add8

View file

@ -34,7 +34,7 @@ def read_csv(csv_path):
else: else:
with csvfile: with csvfile:
reader = csv.DictReader(csvfile, delimiter=",") reader = csv.DictReader(csvfile, delimiter=",")
persons = [{"Name": f"{t['Vorname']} {t['Nachname']}", "Hochschule": f"{t['Standort']}"} for t in reader if persons = [{"Name": f"{t['Amtlicher Vorname'] if t['Amtlicher Vorname'] else t['Vorname']} {t['Nachname']}", "Hochschule": f"{t['Standort']}"} for t in reader if
t['Status'] == "Student"] t['Status'] == "Student"]
persons.sort(key=itemgetter("Hochschule", "Name")) persons.sort(key=itemgetter("Hochschule", "Name"))
for idx, p in enumerate(persons): for idx, p in enumerate(persons):