mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
@ -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:
|
||||
|
@ -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),
|
||||
})
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user