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,6 +179,7 @@ class Facility(TimeStampedModel): ...@@ -179,6 +179,7 @@ class Facility(TimeStampedModel):
if special_schedule.valid_end < and special_schedule.schedule_for_removal: if special_schedule.valid_end < and special_schedule.schedule_for_removal:
self.special_schedules.remove(special_schedule) self.special_schedules.remove(special_schedule)
elif special_schedule.promote_to_main: elif special_schedule.promote_to_main:
if special_schedule.valid_start < and special_schedule.valid_end >=
self.main_schedule = special_schedule self.main_schedule = special_schedule
class Meta: class Meta:
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