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

This commit is contained in:
Jeremy Stretch 2017-02-17 16:10:07 -05:00
parent 4d26fc7e7c
commit 0e5138d6ec

View File

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