Nouvelle import.csv et début
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user