1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge pull request #57 from digitalocean/develop

Release 1.0.3-r1
This commit is contained in:
Jeremy Stretch
2016-06-27 23:24:01 -04:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -187,7 +187,7 @@ class Rack(CreatedUpdatedModel):
# Validate that Rack is tall enough to house the installed Devices
if self.pk:
top_device = Device.objects.filter(rack=self).order_by('-position').first()
top_device = Device.objects.filter(rack=self).exclude(position__isnull=True).order_by('-position').first()
if top_device:
min_height = top_device.position + top_device.device_type.u_height - 1
if self.u_height < min_height:

View File

@ -120,7 +120,7 @@ class ObjectEditView(View):
'obj': obj,
'obj_type': self.model._meta.verbose_name,
'form': form,
'cancel_url': reverse(self.cancel_url) if self.cancel_url else obj.get_absolute_url(),
'cancel_url': obj.get_absolute_url() if obj else reverse(self.cancel_url),
})
def post(self, request, *args, **kwargs):
@ -157,7 +157,7 @@ class ObjectEditView(View):
'obj': obj,
'obj_type': self.model._meta.verbose_name,
'form': form,
'cancel_url': reverse(self.cancel_url) if self.cancel_url else obj.get_absolute_url(),
'cancel_url': obj.get_absolute_url() if obj else reverse(self.cancel_url),
})