Browse Source

Fixes #872: TypeError on bulk IP address creation (Python 3)

Jeremy Stretch 8 years ago
parent
commit
0e5138d6ec
1 changed files with 3 additions and 2 deletions
  1. 3 2
      netbox/utilities/views.py

+ 3 - 2
netbox/utilities/views.py

@@ -307,11 +307,12 @@ class BulkAddView(View):
         if form.is_valid():
 
             # The first field will be used as the pattern
-            pattern_field = form.fields.keys()[0]
+            field_names = list(form.fields.keys())
+            pattern_field = field_names[0]
             pattern = form.cleaned_data[pattern_field]
 
             # All other fields will be copied as object attributes
-            kwargs = {k: form.cleaned_data[k] for k in form.fields.keys()[1:]}
+            kwargs = {k: form.cleaned_data[k] for k in field_names[1:]}
 
             new_objs = []
             try: