mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 17:59:11 -06:00
Fixes #5376: Correct invalid custom field filter logic values
This commit is contained in:
parent
b3d674e170
commit
b68c79be6b
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
* [#5358](https://github.com/netbox-community/netbox/issues/5358) - Fix user table configuration for VM interfaces
|
* [#5358](https://github.com/netbox-community/netbox/issues/5358) - Fix user table configuration for VM interfaces
|
||||||
* [#5374](https://github.com/netbox-community/netbox/issues/5374) - Fix exception thrown when tracing mid-point
|
* [#5374](https://github.com/netbox-community/netbox/issues/5374) - Fix exception thrown when tracing mid-point
|
||||||
|
* [#5376](https://github.com/netbox-community/netbox/issues/5376) - Correct invalid custom field filter logic values
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -51,6 +51,15 @@ def migrate_customfieldvalues(apps, schema_editor):
|
|||||||
model.objects.filter(pk=cfv.obj_id).update(**cf_data)
|
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):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@ -70,4 +79,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
code=migrate_customfieldvalues
|
code=migrate_customfieldvalues
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(
|
||||||
|
code=fix_filter_logic_values
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user