mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +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):
|
||||
if model.oral_mark or model.protocol_mark:
|
||||
try:
|
||||
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(
|
||||
|
|
Loading…
Reference in a new issue