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

Suppressed '__all__' field name in BulkImportForm validation

This commit is contained in:
Jeremy Stretch
2016-06-29 14:52:02 -04:00
parent 2e27389cda
commit 995447ae0b

View File

@ -253,6 +253,9 @@ class BulkImportForm(forms.Form):
else:
for field, errors in obj_form.errors.items():
for e in errors:
self.add_error('csv', "Record {} ({}): {}".format(i, field, e))
if field == '__all__':
self.add_error('csv', "Record {}: {}".format(i, e))
else:
self.add_error('csv', "Record {} ({}): {}".format(i, field, e))
self.cleaned_data['csv'] = obj_list