forked from CGM_Public/pretix_original
Fix broken squashed migration
This commit is contained in:
@@ -7,17 +7,6 @@ import django.db.models.deletion
|
|||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
def assign_checkin_lists(apps, schema_editor):
|
|
||||||
AppConfiguration = apps.get_model('pretixdroid', 'AppConfiguration')
|
|
||||||
|
|
||||||
for ac in AppConfiguration.objects.all():
|
|
||||||
cl = ac.event.checkin_lists.get_or_create(subevent=ac.subevent, all_products=True, defaults={
|
|
||||||
'name': ac.subevent.name if ac.subevent else 'Default'
|
|
||||||
})[0]
|
|
||||||
ac.list = cl
|
|
||||||
ac.save()
|
|
||||||
|
|
||||||
|
|
||||||
def runfwd(app, schema_editor):
|
def runfwd(app, schema_editor):
|
||||||
EventSettingsStore = app.get_model('pretixbase', 'Event_SettingsStore')
|
EventSettingsStore = app.get_model('pretixbase', 'Event_SettingsStore')
|
||||||
AppConfiguration = app.get_model('pretixdroid', 'AppConfiguration')
|
AppConfiguration = app.get_model('pretixdroid', 'AppConfiguration')
|
||||||
@@ -30,6 +19,7 @@ def runfwd(app, schema_editor):
|
|||||||
)
|
)
|
||||||
setting.delete()
|
setting.delete()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
replaces = [('pretixdroid', '0003_appconfiguration'), ('pretixdroid', '0004_auto_20171124_1657'), ('pretixdroid', '0005_auto_20180106_2122')]
|
replaces = [('pretixdroid', '0003_appconfiguration'), ('pretixdroid', '0004_auto_20171124_1657'), ('pretixdroid', '0005_auto_20180106_2122')]
|
||||||
@@ -51,7 +41,6 @@ class Migration(migrations.Migration):
|
|||||||
('show_info', models.BooleanField(default=True)),
|
('show_info', models.BooleanField(default=True)),
|
||||||
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pretixbase.Event')),
|
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pretixbase.Event')),
|
||||||
('items', models.ManyToManyField(blank=True, to='pretixbase.Item')),
|
('items', models.ManyToManyField(blank=True, to='pretixbase.Item')),
|
||||||
('subevent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pretixbase.SubEvent')),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
@@ -83,14 +72,6 @@ class Migration(migrations.Migration):
|
|||||||
name='show_info',
|
name='show_info',
|
||||||
field=models.BooleanField(default=True, help_text='If disabled, the device can not see how many tickets exist and how many are already scanned. pretixdroid 1.6 or newer only.', verbose_name='Show information'),
|
field=models.BooleanField(default=True, help_text='If disabled, the device can not see how many tickets exist and how many are already scanned. pretixdroid 1.6 or newer only.', verbose_name='Show information'),
|
||||||
),
|
),
|
||||||
migrations.RunPython(
|
|
||||||
code=assign_checkin_lists,
|
|
||||||
reverse_code=django.db.migrations.operations.special.RunPython.noop,
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='appconfiguration',
|
|
||||||
name='subevent',
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='appconfiguration',
|
model_name='appconfiguration',
|
||||||
name='list',
|
name='list',
|
||||||
|
|||||||
Reference in New Issue
Block a user