1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Fix boolean logic x(

This commit is contained in:
Mo 2022-06-28 01:17:22 +02:00
parent d8949a9f70
commit efabf619ce

View file

@ -203,7 +203,7 @@ class GroupExperiment(db.Model):
# An experiment specified to a group # An experiment specified to a group
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
note = db.Column(db.Text, nullable=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_id = db.Column(db.Integer, db.ForeignKey("semester_experiment.id"), nullable=False)
semester_experiment = db.relationship("SemesterExperiment", back_populates="group_experiments") semester_experiment = db.relationship("SemesterExperiment", back_populates="group_experiments")
@ -242,10 +242,10 @@ class GroupExperiment(db.Model):
def update_experiment_marks_missing(self): def update_experiment_marks_missing(self):
for experiment_mark in self.experiment_marks: for experiment_mark in self.experiment_marks:
if experiment_mark.final_experiment_mark is None: if experiment_mark.final_experiment_mark is None:
self.experiment_marks_missing = False self.experiment_marks_missing = True
return return
self.experiment_marks_missing = True self.experiment_marks_missing = False
class Experiment(db.Model): class Experiment(db.Model):