mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Avoid checking field
twice on all iterations
Yields a small performance improvement Co-authored-by: Jeremy Stretch <jeremy.stretch@networktocode.com>
This commit is contained in:
parent
cf81a8979f
commit
25cbab2ea4
@ -937,7 +937,7 @@ class ComponentCreateView(GetReturnURLMixin, View):
|
|||||||
# Assign errors on the child form's name/label field to name_pattern/label_pattern on the parent form
|
# Assign errors on the child form's name/label field to name_pattern/label_pattern on the parent form
|
||||||
if field == 'name':
|
if field == 'name':
|
||||||
field = 'name_pattern'
|
field = 'name_pattern'
|
||||||
if field == 'label':
|
elif field == 'label':
|
||||||
field = 'label_pattern'
|
field = 'label_pattern'
|
||||||
for e in errors:
|
for e in errors:
|
||||||
form.add_error(field, '{}: {}'.format(name, ', '.join(e)))
|
form.add_error(field, '{}: {}'.format(name, ', '.join(e)))
|
||||||
|
Loading…
Reference in New Issue
Block a user