From bcdd006dd53ae2f1ae4b9a98ae302206f1ab89d2 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 16 Feb 2022 09:27:16 -0500 Subject: [PATCH] Fixes #8661: Fix ValueError exception when trying to connect a cable --- docs/release-notes/version-3.2.md | 1 + netbox/dcim/views.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/release-notes/version-3.2.md b/docs/release-notes/version-3.2.md index 56bb2755f..742b0532d 100644 --- a/docs/release-notes/version-3.2.md +++ b/docs/release-notes/version-3.2.md @@ -148,6 +148,7 @@ Where it is desired to limit the range of available VLANs within a group, users * [#8655](https://github.com/netbox-community/netbox/issues/8655) - Fix AttributeError when viewing cabled interfaces * [#8659](https://github.com/netbox-community/netbox/issues/8659) - Fix display of multi-object custom fields after deleting related object +* [#8661](https://github.com/netbox-community/netbox/issues/8661) - Fix ValueError exception when trying to connect a cable ### Other Changes diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 1c7cb0c5a..e07029930 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -2768,6 +2768,10 @@ class CableCreateView(generic.ObjectEditView): return super().dispatch(request, *args, **kwargs) + def get_object(self, **kwargs): + # Always return a new instance + return self.queryset.model() + def alter_object(self, obj, request, url_args, url_kwargs): termination_a_type = url_kwargs.get('termination_a_type') termination_a_id = url_kwargs.get('termination_a_id')