From b560c0e3a83571c8d7cb06ae44c686adcd0fa335 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 8 Aug 2025 15:57:04 +0200 Subject: [PATCH] Update src/pretix/base/migrations/0285_voucher_created.py Co-authored-by: luelista --- src/pretix/base/migrations/0285_voucher_created.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/base/migrations/0285_voucher_created.py b/src/pretix/base/migrations/0285_voucher_created.py index ba6dd1b6d9..7b9e44aab0 100644 --- a/src/pretix/base/migrations/0285_voucher_created.py +++ b/src/pretix/base/migrations/0285_voucher_created.py @@ -12,7 +12,7 @@ def backfill_voucher_created(apps, schema_editor): ct = None for v in Voucher.objects.filter(created__isnull=True).iterator(): - if ct: + if not ct: # "Lazy-loading" to prevent this to be executed on new DBs where the content type does not yet # exist -- but also no vouchers do ct = ContentType.objects.get(app_label='pretixbase', model='voucher')