From efabf619ce6ad687cf841eb25c1b32cf41e6d911 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Tue, 28 Jun 2022 01:17:22 +0200 Subject: [PATCH] Fix boolean logic x( --- advlabdb/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/advlabdb/models.py b/advlabdb/models.py index d076e2a..2340e63 100644 --- a/advlabdb/models.py +++ b/advlabdb/models.py @@ -203,7 +203,7 @@ class GroupExperiment(db.Model): # An experiment specified to a group id = db.Column(db.Integer, primary_key=True) note = db.Column(db.Text, nullable=True) - experiment_marks_missing = db.Column(db.Boolean, default=False, nullable=False) + experiment_marks_missing = db.Column(db.Boolean, default=True, nullable=False) semester_experiment_id = db.Column(db.Integer, db.ForeignKey("semester_experiment.id"), nullable=False) semester_experiment = db.relationship("SemesterExperiment", back_populates="group_experiments") @@ -242,10 +242,10 @@ class GroupExperiment(db.Model): def update_experiment_marks_missing(self): for experiment_mark in self.experiment_marks: if experiment_mark.final_experiment_mark is None: - self.experiment_marks_missing = False + self.experiment_marks_missing = True return - self.experiment_marks_missing = True + self.experiment_marks_missing = False class Experiment(db.Model):