Browse Source

Suppressed '__all__' field name in BulkImportForm validation

Jeremy Stretch 8 years ago
parent
commit
995447ae0b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      netbox/utilities/forms.py

+ 4 - 1
netbox/utilities/forms.py

@@ -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