Skip to content

Commit 22a8d7c

Browse files
committed
formatting
1 parent d8984dd commit 22a8d7c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

django_celery_beat/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,13 @@ def from_schedule(cls, schedule):
392392

393393
def due_start_time(self, start_time):
394394
start, ends_in, now = self.schedule.remaining_delta(start_time)
395-
if (str(start.tzinfo) == str(now.tzinfo) and
396-
now.utcoffset() != start.utcoffset()):
395+
396+
same_tz = str(start.tzinfo) == str(now.tzinfo)
397+
different_offset = now.utcoffset() != start.utcoffset()
398+
399+
if same_tz and different_offset:
397400
start = start.replace(tzinfo=now.tzinfo)
401+
398402
return start + ends_in
399403

400404

0 commit comments

Comments
 (0)