From b84ac184c2070022f2e67d70d29b3a5a00eefdc7 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 19 Apr 2023 09:58:18 -0400 Subject: [PATCH] #8684: Remove obsolete 'obj' var from custom link context --- docs/customization/custom-links.md | 1 - docs/release-notes/version-3.5.md | 1 + netbox/extras/templatetags/custom_links.py | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/customization/custom-links.md b/docs/customization/custom-links.md index 16ba9d2af..5d1cd4556 100644 --- a/docs/customization/custom-links.md +++ b/docs/customization/custom-links.md @@ -27,7 +27,6 @@ The following context data is available within the template when rendering a cus | Variable | Description | |-----------|-------------------------------------------------------------------------------------------------------------------| | `object` | The NetBox object being displayed | -| `obj` | Same as `object`; maintained for backward compatability until NetBox v3.5 | | `debug` | A boolean indicating whether debugging is enabled | | `request` | The current WSGI request | | `user` | The current user (if authenticated) | diff --git a/docs/release-notes/version-3.5.md b/docs/release-notes/version-3.5.md index ee9b04628..169946a4d 100644 --- a/docs/release-notes/version-3.5.md +++ b/docs/release-notes/version-3.5.md @@ -8,6 +8,7 @@ * The JobResult model has been moved from the `extras` app to `core` and renamed to Job. Accordingly, its REST API endpoint has been moved from `/api/extras/job-results/` to `/api/core/jobs/`. * The `obj_type` field on the Job model (previously JobResult) has been renamed to `object_type` for consistency with other models. * The `JOBRESULT_RETENTION` configuration parameter has been renamed to `JOB_RETENTION`. +* The `obj` context variable is no longer passed when rendering custom links: Use `object` instead. * The REST API schema is now generated using the OpenAPI 3.0 spec * The URLs for the REST API schema documentation have changed: * `/api/docs/` is now `/api/schema/swagger-ui/` diff --git a/netbox/extras/templatetags/custom_links.py b/netbox/extras/templatetags/custom_links.py index b7d8d1448..5de95b607 100644 --- a/netbox/extras/templatetags/custom_links.py +++ b/netbox/extras/templatetags/custom_links.py @@ -40,7 +40,6 @@ def custom_links(context, obj): # Pass select context data when rendering the CustomLink link_context = { 'object': obj, - 'obj': obj, # TODO: Remove in NetBox v3.5 'debug': context.get('debug', False), # django.template.context_processors.debug 'request': context['request'], # django.template.context_processors.request 'user': context['user'], # django.contrib.auth.context_processors.auth