Nouvelle import.csv et début

This commit is contained in:
Ambulance Clerc
2023-09-12 09:48:51 +02:00
parent 76703be622
commit e9d1b20a14
2 changed files with 12 additions and 8 deletions

View File

@@ -233,8 +233,12 @@ def import_data_csv():
value = datetime.strptime(value, "%d.%m.%Y").date()
elif key == "Student" and value != "":
print(f"user == pk{value}")
temp_user = User.objects.get(pk=int(value))
setattr(new_eval, "Student", temp_user)
try:
temp_user = User.objects.get(pk=int(value))
setattr(new_eval, "Student", temp_user)
except:
print(f"User not found {int(value)} {line}")
pass
continue
elif key == "ID":
pass