diff --git a/docs/release-notes/version-2.10.md b/docs/release-notes/version-2.10.md index 351f5462b..d5df2ae49 100644 --- a/docs/release-notes/version-2.10.md +++ b/docs/release-notes/version-2.10.md @@ -1,12 +1,16 @@ # NetBox v2.10 -## v2.10.1 (Future Release) +## v2.10.1 (FUTURE) ### Bug Fixes * [#5450](https://github.com/netbox-community/netbox/issues/5450) - API serializer foreign count fields do not have a default value +* [#5453](https://github.com/netbox-community/netbox/issues/5453) - Correct change log representation when creating a cable * [#5458](https://github.com/netbox-community/netbox/issues/5458) - Creating a component template throws an exception * [#5461](https://github.com/netbox-community/netbox/issues/5461) - Rack Elevations throw reverse match exception +* [#5463](https://github.com/netbox-community/netbox/issues/5463) - Back-to-back Circuit Termination throws AttributeError exception + +--- ## v2.10.0 (2020-12-14) diff --git a/netbox/circuits/views.py b/netbox/circuits/views.py index 653c881a9..a237b8805 100644 --- a/netbox/circuits/views.py +++ b/netbox/circuits/views.py @@ -139,7 +139,7 @@ class CircuitView(generic.ObjectView): ).filter( circuit=instance, term_side=CircuitTerminationSideChoices.SIDE_A ).first() - if termination_a and termination_a.connected_endpoint: + if termination_a and termination_a.connected_endpoint and hasattr(termination_a.connected_endpoint, 'ip_addresses'): termination_a.ip_addresses = termination_a.connected_endpoint.ip_addresses.restrict(request.user, 'view') # Z-side termination @@ -148,7 +148,7 @@ class CircuitView(generic.ObjectView): ).filter( circuit=instance, term_side=CircuitTerminationSideChoices.SIDE_Z ).first() - if termination_z and termination_z.connected_endpoint: + if termination_z and termination_z.connected_endpoint and hasattr(termination_z.connected_endpoint, 'ip_addresses'): termination_z.ip_addresses = termination_z.connected_endpoint.ip_addresses.restrict(request.user, 'view') return { diff --git a/netbox/dcim/models/cables.py b/netbox/dcim/models/cables.py index 7a9f2dc2c..6a530bb49 100644 --- a/netbox/dcim/models/cables.py +++ b/netbox/dcim/models/cables.py @@ -147,7 +147,8 @@ class Cable(ChangeLoggedModel, CustomFieldModel): return instance def __str__(self): - return self.label or '#{}'.format(self._pk) + pk = self.pk or self._pk + return self.label or f'#{pk}' def get_absolute_url(self): return reverse('dcim:cable', args=[self.pk]) diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 97a4f3705..91ec8776c 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -302,6 +302,14 @@ class RackTestCase(ViewTestCases.PrimaryObjectViewTestCase): 'comments': 'New comments', } + @override_settings(EXEMPT_VIEW_PERMISSIONS=['*']) + def test_list_rack_elevations(self): + """ + Test viewing the list of rack elevations. + """ + response = self.client.get(reverse('dcim:rack_elevation_list')) + self.assertHttpStatus(response, 200) + class ManufacturerTestCase(ViewTestCases.OrganizationalObjectViewTestCase): model = Manufacturer