From acefd98ef2f7d9f32f8da83fd905d9fdf12ad9f3 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Wed, 26 Apr 2023 12:39:07 +0200 Subject: [PATCH] Respect TZ for op.valid_from/valid_until in checkin error messages --- src/pretix/base/services/checkin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pretix/base/services/checkin.py b/src/pretix/base/services/checkin.py index 588f1a4ee..6054f2951 100644 --- a/src/pretix/base/services/checkin.py +++ b/src/pretix/base/services/checkin.py @@ -740,11 +740,11 @@ def perform_checkin(op: OrderPosition, clist: CheckinList, given_answers: dict, else: raise CheckInError( _('This ticket is only valid after {datetime}.').format( - datetime=date_format(op.valid_from, 'SHORT_DATETIME_FORMAT') + datetime=date_format(op.valid_from.astimezone(clist.event.timezone), 'SHORT_DATETIME_FORMAT') ), 'invalid_time', _('This ticket is only valid after {datetime}.').format( - datetime=date_format(op.valid_from, 'SHORT_DATETIME_FORMAT') + datetime=date_format(op.valid_from.astimezone(clist.event.timezone), 'SHORT_DATETIME_FORMAT') ), ) @@ -754,11 +754,11 @@ def perform_checkin(op: OrderPosition, clist: CheckinList, given_answers: dict, else: raise CheckInError( _('This ticket was only valid before {datetime}.').format( - datetime=date_format(op.valid_until, 'SHORT_DATETIME_FORMAT') + datetime=date_format(op.valid_until.astimezone(clist.event.timezone), 'SHORT_DATETIME_FORMAT') ), 'invalid_time', _('This ticket was only valid before {datetime}.').format( - datetime=date_format(op.valid_until, 'SHORT_DATETIME_FORMAT') + datetime=date_format(op.valid_until.astimezone(clist.event.timezone), 'SHORT_DATETIME_FORMAT') ), )