diff --git a/bartenders/management/commands/generate_barshifts.py b/bartenders/management/commands/generate_barshifts.py index bfd66c4..dfd3e40 100644 --- a/bartenders/management/commands/generate_barshifts.py +++ b/bartenders/management/commands/generate_barshifts.py @@ -255,9 +255,8 @@ def handle(self, *args, **options): second_start_naive = datetime.datetime.combine( shift_start.date(), DOUBLE_SECOND_SHIFT_START ) - second_start = timezone.get_default_timezone().localize( - second_start_naive - ) + tz = timezone.get_current_timezone() + second_start = timezone.make_aware(second_start_naive, tz) second_end = second_start + DOUBLE_SECOND_SHIFT_DURATION shift_periods[-1] = (shift_start, second_start) diff --git a/bartenders/models.py b/bartenders/models.py index 70fdb6a..ca76e76 100644 --- a/bartenders/models.py +++ b/bartenders/models.py @@ -421,8 +421,9 @@ def with_bartender(self, bartender): ) def has_multiple_shifts(self): - start = timezone.get_default_timezone().localize( - datetime.datetime.combine(self.date, datetime.time()) + tz = timezone.get_current_timezone() + start = timezone.make_aware( + datetime.datetime.combine(self.date, datetime.time()), tz ) end = start + datetime.timedelta(days=1) return (