This commit is contained in:
brocasm
2023-09-10 23:21:49 +02:00
parent cd61e7564a
commit c4b7fcd629

View File

@@ -230,7 +230,7 @@ def import_data_csv():
value = line[key]
if key == "dtDate":
value = datetime.strptime(value, "%d.%m.%Y").date()
elif key == "Student" and value is not "":
elif key == "Student" and value != "":
print(f"user == pk{value}")
temp_user = User.objects.get(pk=int(value))
setattr(new_eval, "Student", temp_user)
@@ -240,7 +240,7 @@ def import_data_csv():
if key in ["nEval_Type","nInter_Priority","nInter_Nature","nInter_Complexity","nStudent_Role","nEval_Mode"]:
print(f"key [{key}] => {value}")
value = int(value) if value is not "" else ""
value = int(value) if value != "" else ""
setattr(new_eval, key,value)
print(f"try to save {line}")