1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Added final part mark calculation to assistantSpace

This commit is contained in:
Mo 2021-08-21 23:08:32 +02:00
parent 9430654ea1
commit 4a83ffdabc

View file

@ -118,16 +118,20 @@ class AssistantExperimentMarkView(SecureAssistantModelView):
)
)
def after_model_change(self, form, model, is_created):
if model.oral_mark or model.protocol_mark:
try:
model.assistant = current_user.assistant
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
):
model.assistant = current_user.assistant
self.session.commit()
except Exception as ex:
flash(str(ex), "error")
ret = super().update_model(form, model)
self.session.rollback()
model.part_student.checkThenSetFinalPartMark()
return ret
else:
# Nothing changed
return True
assistantSpace.add_view(