Skip to content

Commit

Permalink
Fix web oncall calendars not loading (#891)
Browse files Browse the repository at this point in the history
* Fix oncall schedules bug

* Update custom_on_call_shift.py
  • Loading branch information
iskhakov authored Nov 23, 2022
1 parent bd27584 commit 2052faa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/apps/schedules/models/custom_on_call_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ def convert_to_ical(self, time_zone="UTC", allow_empty_users=False):
expected_start_day = min(CustomOnCallShift.ICAL_WEEKDAY_REVERSE_MAP[d] for d in self.by_day)
delta = (expected_start_day - start.weekday()) % 7
start = start + timezone.timedelta(days=delta)
if self.until is not None:
self.until = self.until + timezone.timedelta(days=delta)

if self.frequency == CustomOnCallShift.FREQUENCY_DAILY and self.by_day:
result = self._daily_by_day_to_ical(time_zone, start, users_queue)
Expand Down

0 comments on commit 2052faa

Please sign in to comment.