From 5d4ef5e9e54d81829f0b74e3f1529c285b8fa223 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 26 Apr 2023 13:27:55 -0700 Subject: [PATCH 1/4] 11607 make CableSerializer WritableNestedSerializer for to_internal value instantiation --- netbox/dcim/api/nested_serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/api/nested_serializers.py b/netbox/dcim/api/nested_serializers.py index 29881a548..f57451d17 100644 --- a/netbox/dcim/api/nested_serializers.py +++ b/netbox/dcim/api/nested_serializers.py @@ -425,7 +425,7 @@ class NestedInventoryItemRoleSerializer(WritableNestedSerializer): # Cables # -class NestedCableSerializer(BaseModelSerializer): +class NestedCableSerializer(WritableNestedSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:cable-detail') class Meta: From 4355085124204838235ba5ab71a203fae7b2fbbd Mon Sep 17 00:00:00 2001 From: x64x6a Date: Wed, 26 Apr 2023 13:02:32 -0700 Subject: [PATCH 2/4] Fixes #12355: Exclude additional characters from url encode --- netbox/extras/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/extras/models/models.py b/netbox/extras/models/models.py index 718cba5c1..b054882ea 100644 --- a/netbox/extras/models/models.py +++ b/netbox/extras/models/models.py @@ -279,7 +279,7 @@ class CustomLink(CloningMixin, ExportTemplatesMixin, WebhooksMixin, ChangeLogged text = clean_html(text, allowed_schemes) # Sanitize link - link = urllib.parse.quote_plus(link, safe='/:?&') + link = urllib.parse.quote_plus(link, safe='/:?&=%+[]@#') # Verify link scheme is allowed result = urllib.parse.urlparse(link) From 9a788349a94c925a21f3f4cd62d6fd79689db023 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Thu, 27 Apr 2023 08:26:14 -0700 Subject: [PATCH 3/4] 12252 allow sorting on object in search (#12357) * 12252 allow sorting on object in search * 12252 code review changes --- netbox/netbox/search/backends.py | 9 ++++++--- netbox/netbox/tables/tables.py | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/netbox/netbox/search/backends.py b/netbox/netbox/search/backends.py index f428842f5..4487b6bb8 100644 --- a/netbox/netbox/search/backends.py +++ b/netbox/netbox/search/backends.py @@ -145,9 +145,12 @@ class CachedValueSearchBackend(SearchBackend): ) # Omit any results pertaining to an object the user does not have permission to view - return [ - r for r in results if r.object is not None - ] + ret = [] + for r in results: + if r.object is not None: + r.name = str(r.object) + ret.append(r) + return ret def cache(self, instances, indexer=None, remove_existing=True): content_type = None diff --git a/netbox/netbox/tables/tables.py b/netbox/netbox/tables/tables.py index 3047719b7..ee171f1a8 100644 --- a/netbox/netbox/tables/tables.py +++ b/netbox/netbox/tables/tables.py @@ -204,7 +204,8 @@ class SearchTable(tables.Table): order_by="object___meta__verbose_name", ) object = tables.Column( - linkify=True + linkify=True, + order_by=('name', ) ) field = tables.Column() value = tables.Column() From 84089ab8c5e1b5107c7ae75bb4cad53d900ef9d2 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 27 Apr 2023 11:47:42 -0400 Subject: [PATCH 4/4] Release v3.4.10 --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- docs/release-notes/version-3.4.md | 10 ++++++++++ netbox/netbox/settings.py | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 956b682b0..c71ee6f3e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.4.9 + placeholder: v3.4.10 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index d3f337175..16e4981cb 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.4.9 + placeholder: v3.4.10 validations: required: true - type: dropdown diff --git a/docs/release-notes/version-3.4.md b/docs/release-notes/version-3.4.md index bcb3a9ad2..22c33bb01 100644 --- a/docs/release-notes/version-3.4.md +++ b/docs/release-notes/version-3.4.md @@ -1,5 +1,15 @@ # NetBox v3.4 +## v3.4.10 (2023-04-27) + +### Bug Fixes + +* [#11607](https://github.com/netbox-community/netbox/issues/11607) - Fix custom object field assignments made via REST API for for cables +* [#12252](https://github.com/netbox-community/netbox/issues/12252) - Fix ordering of search results when sorting by object name +* [#12355](https://github.com/netbox-community/netbox/issues/12355) - Fix escaping of certain characters in URL when rendering custom links + +--- + ## v3.4.9 (2023-04-26) ### Enhancements diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 03970ff75..82c9c7af2 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -25,7 +25,7 @@ from netbox.constants import RQ_QUEUE_DEFAULT, RQ_QUEUE_HIGH, RQ_QUEUE_LOW # Environment setup # -VERSION = '3.4.9' +VERSION = '3.4.10' # Hostname HOSTNAME = platform.node()