Skip to content

Commit 07a7fac

Browse files
committed
Allow custom fields in the Device CSV form
1 parent f945216 commit 07a7fac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

netbox/dcim/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def __init__(self, *args, **kwargs):
825825
self.initial['rack'] = self.instance.parent_bay.device.rack_id
826826

827827

828-
class BaseDeviceCSVForm(forms.ModelForm):
828+
class BaseDeviceCSVForm(BootstrapMixin, CustomFieldForm):
829829
device_role = forms.ModelChoiceField(
830830
queryset=DeviceRole.objects.all(),
831831
to_field_name='name',

netbox/utilities/templatetags/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def example_choices(field, arg=3):
116116
if not id:
117117
continue
118118
examples.append(label)
119-
return ', '.join(examples) or 'None'
119+
return ', '.join([ str(e) for e in examples ]) or 'None'
120120

121121

122122
#

0 commit comments

Comments
 (0)