From c5e74635ddb9f93a53cb4ff3d072e7cadbe8e03a Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 21 Jul 2021 15:44:14 -0400 Subject: [PATCH 1/3] Fixes #6778: Rack reservation should display rack's location --- docs/release-notes/version-2.11.md | 1 + netbox/templates/dcim/rackreservation.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index b8cd02ea7..0afe81ffd 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -6,6 +6,7 @@ * [#5442](https://github.com/netbox-community/netbox/issues/5442) - Fix assignment of permissions based on LDAP groups * [#6773](https://github.com/netbox-community/netbox/issues/6773) - Add missing `display` field to rack unit serializer +* [#6778](https://github.com/netbox-community/netbox/issues/6778) - Rack reservation should display rack's location --- diff --git a/netbox/templates/dcim/rackreservation.html b/netbox/templates/dcim/rackreservation.html index 06e14e7db..8d4fa735c 100644 --- a/netbox/templates/dcim/rackreservation.html +++ b/netbox/templates/dcim/rackreservation.html @@ -39,10 +39,10 @@ - Group + Location - {% if rack.group %} - {{ rack.group }} + {% if rack.location %} + {{ rack.location }} {% else %} None {% endif %} From 33e825e91edd3ce29a60c5dff5a0e48162436937 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 21 Jul 2021 15:49:01 -0400 Subject: [PATCH 2/3] Fixes #6780: Include rack location in navigation breadcrumbs --- docs/release-notes/version-2.11.md | 1 + netbox/templates/dcim/rack.html | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 0afe81ffd..31607eb45 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -7,6 +7,7 @@ * [#5442](https://github.com/netbox-community/netbox/issues/5442) - Fix assignment of permissions based on LDAP groups * [#6773](https://github.com/netbox-community/netbox/issues/6773) - Add missing `display` field to rack unit serializer * [#6778](https://github.com/netbox-community/netbox/issues/6778) - Rack reservation should display rack's location +* [#6780](https://github.com/netbox-community/netbox/issues/6780) - Include rack location in navigation breadcrumbs --- diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index ada93518f..94f0ea24c 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -9,11 +9,11 @@ {% block breadcrumbs %}
  • Racks
  • {{ object.site }}
  • - {% if object.group %} - {% for group in object.group.get_ancestors %} -
  • {{ group }}
  • + {% if object.location %} + {% for location in object.location.get_ancestors %} +
  • {{ location }}
  • {% endfor %} -
  • {{ object.group }}
  • +
  • {{ object.location }}
  • {% endif %}
  • {{ object }}
  • {% endblock %} From a038e8bba4ac90017e013d68c53dd97f2c89b3cf Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 21 Jul 2021 16:02:32 -0400 Subject: [PATCH 3/3] Fixes #6777: Fix default value validation for custom text fields --- docs/release-notes/version-2.11.md | 1 + netbox/extras/models/customfields.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 31607eb45..953f42d5c 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -6,6 +6,7 @@ * [#5442](https://github.com/netbox-community/netbox/issues/5442) - Fix assignment of permissions based on LDAP groups * [#6773](https://github.com/netbox-community/netbox/issues/6773) - Add missing `display` field to rack unit serializer +* [#6777](https://github.com/netbox-community/netbox/issues/6777) - Fix default value validation for custom text fields * [#6778](https://github.com/netbox-community/netbox/issues/6778) - Rack reservation should display rack's location * [#6780](https://github.com/netbox-community/netbox/issues/6780) - Include rack location in navigation breadcrumbs diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index 60c6adce9..a433a3f81 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -149,7 +149,8 @@ class CustomField(BigIDModel): # Validate the field's default value (if any) if self.default is not None: try: - self.validate(self.default) + default_value = str(self.default) if self.type == CustomFieldTypeChoices.TYPE_TEXT else self.default + self.validate(default_value) except ValidationError as err: raise ValidationError({ 'default': f'Invalid default value "{self.default}": {err.message}'