mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Allow quota-level vouchers for hidden products (#1123)
* Changes in checks * Backwards-compatible implementation * Add test * Fix voucher bulk form
This commit is contained in:
26
src/pretix/base/migrations/0125_voucher_show_hidden_items.py
Normal file
26
src/pretix/base/migrations/0125_voucher_show_hidden_items.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 2.2.1 on 2019-07-07 10:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def set_show_hidden_items(apps, schema_editor):
|
||||
Voucher = apps.get_model('pretixbase', 'Voucher')
|
||||
Voucher.objects.filter(quota__isnull=False).update(show_hidden_items=False)
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pretixbase', '0124_seat_seat_guid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='voucher',
|
||||
name='show_hidden_items',
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
set_show_hidden_items,
|
||||
migrations.RunPython.noop,
|
||||
)
|
||||
]
|
||||
Reference in New Issue
Block a user