mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #872: TypeError on bulk IP address creation (Python 3)
This commit is contained in:
parent
4d26fc7e7c
commit
0e5138d6ec
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user