mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #5376: Correct invalid custom field filter logic values
This commit is contained in:
@ -51,6 +51,15 @@ def migrate_customfieldvalues(apps, schema_editor):
|
||||
model.objects.filter(pk=cfv.obj_id).update(**cf_data)
|
||||
|
||||
|
||||
def fix_filter_logic_values(apps, schema_editor):
|
||||
"""
|
||||
Fix invalid values for CustomField.filter_logic (see #5376)
|
||||
"""
|
||||
CustomField = apps.get_model('extras', 'CustomField')
|
||||
|
||||
CustomField.objects.filter(filter_logic="integer").update(filter_logic="loose")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
@ -70,4 +79,7 @@ class Migration(migrations.Migration):
|
||||
migrations.RunPython(
|
||||
code=migrate_customfieldvalues
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=fix_filter_logic_values
|
||||
),
|
||||
]
|
||||
|
Reference in New Issue
Block a user