1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Explicit None check

This commit is contained in:
Mo 2022-05-15 22:25:19 +02:00
parent 9ff2405947
commit fe8dceceba

View file

@ -125,16 +125,16 @@ class AssistantExperimentMarkView(SecureAssistantModelView):
)
def update_model(self, form, model):
if (form.oral_mark and form.oral_mark.data != model.oral_mark) or (
form.protocol_mark and form.protocol_mark.data != model.protocol_mark
if (form.oral_mark is not None and form.oral_mark.data != model.oral_mark) or (
form.protocol_mark is not None and form.protocol_mark.data != model.protocol_mark
):
model.assistant = current_user.assistant
ret = super().update_model(form, model)
updateSuccessful = super().update_model(form, model)
model.part_student.checkThenSetFinalPartMark()
return ret
return updateSuccessful
else:
# Nothing changed
return True