mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Allow for gt and gte selection of change_allow_user_price (#1746)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def migrate_change_allow_user_price(apps, schema_editor):
|
||||
# Previously, the "gt" value was meant to represent "greater or equal", which became an issue the moment
|
||||
# we introduced a "greater" and "greater or equal" option. This migrates any previous "greater or equal"
|
||||
# selection to the new "gte".
|
||||
Event_SettingsStore = apps.get_model('pretixbase', 'Event_SettingsStore')
|
||||
Event_SettingsStore.objects.filter(key="change_allow_user_price", value="gt").update(value="gte")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pretixbase', '0160_multiple_confirm_texts'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(migrate_change_allow_user_price, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user