1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Update netbox/utilities/templatetags/form_helpers.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Daniel Sheppard
2024-03-21 22:37:06 -05:00
committed by GitHub
parent f257f4aad4
commit 8a7df0b98d

View File

@@ -36,11 +36,7 @@ def getfield(form, fieldname):
@register.filter()
def get_filter_field(form, fieldname):
field = getfield(form, f'{fieldname}')
if field is not None:
return field
else:
return getfield(form, f'{fieldname}_id')
return getfield(form, f'{fieldname}') or getfield(form, f'{fieldname}_id')
@register.filter(name='widget_type')