mirror of
https://github.com/pretix/pretix.git
synced 2026-08-04 09:47:50 +00:00
Update src/pretix/base/migrations/0285_voucher_created.py
Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
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')
|
||||
|
||||
Reference in New Issue
Block a user