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:
parent
9430654ea1
commit
4a83ffdabc
1 changed files with 12 additions and 8 deletions
|
@ -118,16 +118,20 @@ class AssistantExperimentMarkView(SecureAssistantModelView):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def after_model_change(self, form, model, is_created):
|
def update_model(self, form, model):
|
||||||
if model.oral_mark or model.protocol_mark:
|
if (form.oral_mark and form.oral_mark.data != model.oral_mark) or (
|
||||||
try:
|
form.protocol_mark and form.protocol_mark.data != model.protocol_mark
|
||||||
model.assistant = current_user.assistant
|
):
|
||||||
|
model.assistant = current_user.assistant
|
||||||
|
|
||||||
self.session.commit()
|
ret = super().update_model(form, model)
|
||||||
except Exception as ex:
|
|
||||||
flash(str(ex), "error")
|
|
||||||
|
|
||||||
self.session.rollback()
|
model.part_student.checkThenSetFinalPartMark()
|
||||||
|
|
||||||
|
return ret
|
||||||
|
else:
|
||||||
|
# Nothing changed
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
assistantSpace.add_view(
|
assistantSpace.add_view(
|
||||||
|
|
Loading…
Reference in a new issue