Update src/pretix/base/migrations/0285_voucher_created.py

Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
Raphael Michel
2025-08-08 15:57:04 +02:00
committed by GitHub
co-authored by luelista
parent 69fa883409
commit b560c0e3a8
@@ -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')