From d0fb95d31ef4c9fe2382e4e4068fe26368d74347 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 18 May 2016 13:19:26 -0400 Subject: [PATCH] Fixed type bug in DeviceForm --- netbox/dcim/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index c4651ed58..7191fd6bc 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -378,9 +378,9 @@ class DeviceForm(forms.ModelForm, BootstrapMixin): # Rack position try: - if self.is_bound and self.data.get('rack') and self.data.get('face') is not None: + if self.is_bound and self.data.get('rack') and str(self.data.get('face')): position_choices = Rack.objects.get(pk=self.data['rack']).get_rack_units(face=self.data.get('face')) - elif self.initial.get('rack') and self.initial.get('face') is not None: + elif self.initial.get('rack') and str(self.initial.get('face')): position_choices = Rack.objects.get(pk=self.initial['rack']).get_rack_units(face=self.initial.get('face')) else: position_choices = []