Verified Commit 8416d22c authored by David Haynes's avatar David Haynes 🙆
Browse files

Add additional condition to check that the promoted schedule is in effect

- only promote if it is active
parent e4c212d4
Pipeline #1733 passed with stage
in 1 minute and 40 seconds
......@@ -179,7 +179,8 @@ class Facility(TimeStampedModel):
if special_schedule.valid_end < datetime.date.today() and special_schedule.schedule_for_removal:
self.special_schedules.remove(special_schedule)
elif special_schedule.promote_to_main:
self.main_schedule = special_schedule
if special_schedule.valid_start < datetime.date.today() and special_schedule.valid_end >= datetime.date.today():
self.main_schedule = special_schedule
class Meta:
verbose_name = "facility"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment