From 4332e145b77c96d847cdc9589519524616a1376f Mon Sep 17 00:00:00 2001 From: Mo8it Date: Mon, 16 May 2022 17:17:11 +0200 Subject: [PATCH] Use session.get --- advlabdb/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advlabdb/models.py b/advlabdb/models.py index a8157ae..f30fa2a 100644 --- a/advlabdb/models.py +++ b/advlabdb/models.py @@ -447,6 +447,8 @@ class Semester(db.Model): __table_args__ = (db.UniqueConstraint(label, year),) + # TODO: def __init__(self, label, year): + def initFromOldSemester(label, year, oldSemester, transferParts, transferAssistants): semester = Semester(label=label, year=year) @@ -482,7 +484,7 @@ class ExperimentMark(db.Model): def final_experiment_mark_update(context): params = context.get_current_parameters() - experimentMark = ExperimentMark.query.get(params["experiment_mark_id"]) + experimentMark = db.session.get(ExperimentMark, params["experiment_mark_id"]) oral_mark = params.get("oral_mark") if oral_mark is None: