mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Fix possible crash in migration
This commit is contained in:
@@ -10,10 +10,11 @@ def migrate_confirm_text(apps, schema_editor):
|
|||||||
# from `confirm_text` to `confirm_texts`
|
# from `confirm_text` to `confirm_texts`
|
||||||
Event_SettingsStore = apps.get_model('pretixbase', 'Event_SettingsStore')
|
Event_SettingsStore = apps.get_model('pretixbase', 'Event_SettingsStore')
|
||||||
for store in Event_SettingsStore.objects.filter(key="confirm_text"):
|
for store in Event_SettingsStore.objects.filter(key="confirm_text"):
|
||||||
values = json.dumps([json.loads(store.value)]) # convert single value to one-element list
|
if store.value:
|
||||||
store.key = "confirm_texts"
|
values = json.dumps([json.loads(store.value)]) # convert single value to one-element list
|
||||||
store.value = values
|
store.key = "confirm_texts"
|
||||||
store.save()
|
store.value = values
|
||||||
|
store.save()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
Reference in New Issue
Block a user