From bc930ae6bcae72491655a411e65ef76fffc8da9b Mon Sep 17 00:00:00 2001 From: Anthony Lukach Date: Thu, 12 Oct 2023 16:19:41 -0700 Subject: [PATCH] Aggressively prune draft_uuid --- app/admin_ui/tables/tables.py | 18 +++++++----------- .../templates/snippets/object_header_tabs.html | 2 +- app/admin_ui/templatetags/template_extras.py | 1 - app/admin_ui/urls.py | 4 ++-- app/admin_ui/views/change.py | 1 - app/admin_ui/views/v2.py | 7 +------ 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/app/admin_ui/tables/tables.py b/app/admin_ui/tables/tables.py index e1db09b4..2584e0d2 100644 --- a/app/admin_ui/tables/tables.py +++ b/app/admin_ui/tables/tables.py @@ -505,8 +505,6 @@ def render_short_name(self, value, record): 'canonical-redirect', kwargs={ "canonical_uuid": record.uuid, - # this property is coming from an annotation on the inital query - "draft_uuid": record.draft_uuid, "model": camel_to_snake(record.model_name), }, ), @@ -526,7 +524,13 @@ class CampaignChangeListTable(LimitedTableBase): verbose_name="Short Name", accessor="latest_update__short_name", update_accessor="content_object.short_name", - linkify=("change-update", [tables.A("uuid")]), + linkify=( + "canonical-redirect", + { + "canonical_uuid": tables.A('uuid'), + "model": 'campaign', + }, + ), ) funding_agency = ConditionalValueColumn( verbose_name="Funding Agency", @@ -578,8 +582,6 @@ def render_short_name(self, value, record): 'canonical-redirect', kwargs={ "canonical_uuid": record.uuid, - # this property is coming from an annotation on the inital query - "draft_uuid": record.draft_uuid, "model": camel_to_snake(record.model_name), }, ), @@ -600,8 +602,6 @@ def render_short_name(self, value, record): 'canonical-redirect', kwargs={ "canonical_uuid": record.uuid, - # this property is coming from an annotation on the inital query - "draft_uuid": record.draft_uuid, "model": camel_to_snake(record.model_name), }, ), @@ -633,8 +633,6 @@ def render_short_name(self, value, record): 'canonical-redirect', kwargs={ "canonical_uuid": record.model_instance_uuid or record.uuid, - # TODO this change object has not property draft uuid - "draft_uuid": record.uuid, "model": camel_to_snake(record.model_name), }, ), @@ -909,8 +907,6 @@ def render_short_name(self, value, record): 'canonical-redirect', kwargs={ "canonical_uuid": record.uuid, - # this property is coming from an annotation on the inital query - "draft_uuid": record.draft_uuid, "model": camel_to_snake(record.model_name), }, ), diff --git a/app/admin_ui/templates/snippets/object_header_tabs.html b/app/admin_ui/templates/snippets/object_header_tabs.html index 20429bee..5b418a49 100644 --- a/app/admin_ui/templates/snippets/object_header_tabs.html +++ b/app/admin_ui/templates/snippets/object_header_tabs.html @@ -7,7 +7,7 @@