mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Parse mark selection
This commit is contained in:
parent
eb09b793c6
commit
89a0d295fe
1 changed files with 17 additions and 4 deletions
|
@ -20,6 +20,7 @@ from .model_dependent_funs import (
|
|||
generate_new_password_field,
|
||||
initActiveSemesterMenuLinks,
|
||||
mark_field,
|
||||
parse_selection_mark_field,
|
||||
user_info_fields,
|
||||
)
|
||||
from .model_independent_funs import randomPassword, reportBadAttempt
|
||||
|
@ -101,12 +102,24 @@ class AssistantGroupExperimentView(SecureAssistantModelView):
|
|||
]
|
||||
|
||||
if form.validate_on_submit():
|
||||
for ind, appointment in enumerate(appointments):
|
||||
appointment.date = appointment_fields[ind].data
|
||||
try:
|
||||
for ind, appointment in enumerate(appointments):
|
||||
appointment.date = appointment_fields[ind].data
|
||||
|
||||
group_experiment.note = form.note.data
|
||||
for ind, experiment_mark in enumerate(experiment_marks):
|
||||
experiment_mark.oral_mark = parse_selection_mark_field(oral_experiment_mark_fields[ind])
|
||||
experiment_mark.protocol_mark = parse_selection_mark_field(protocol_experiment_mark_fields[ind])
|
||||
|
||||
db.session.commit()
|
||||
group_experiment.note = form.note.data
|
||||
|
||||
db.session.commit()
|
||||
|
||||
red = url_for("index") + "assistant/group_experiment"
|
||||
return redirect(red)
|
||||
except Exception as ex:
|
||||
flash(str(ex), "error")
|
||||
|
||||
db.session.rollback()
|
||||
|
||||
return self.render(
|
||||
"assistant_group_experiment_form.html",
|
||||
|
|
Loading…
Reference in a new issue