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 @@
Published
diff --git a/app/admin_ui/templatetags/template_extras.py b/app/admin_ui/templatetags/template_extras.py
index 81e4d506..676123d7 100644
--- a/app/admin_ui/templatetags/template_extras.py
+++ b/app/admin_ui/templatetags/template_extras.py
@@ -94,7 +94,6 @@ def object_header_tabs(context, change: Change, canonical_change: Optional[Chang
"draft_status": draft_status,
"draft_status_class": draft_status_class,
"canonical_uuid": canonical_uuid,
- "draft_uuid": change.uuid,
"has_progress_draft": has_progress_draft,
"has_published_draft": has_published_draft,
"request": context.get("request"),
diff --git a/app/admin_ui/urls.py b/app/admin_ui/urls.py
index e87a4353..aba89fab 100644
--- a/app/admin_ui/urls.py
+++ b/app/admin_ui/urls.py
@@ -58,13 +58,13 @@
path('v2/', v2.CanonicalRecordList.as_view(), name="canonical-list"),
# Helper route to redirect user to appropriate view without prior knowledge of record's status (ie if it's been published). If published, return redirect to `//published`. Otherwise, redirect to `//edit`.
path(
- 'v2///',
+ 'v2//',
v2.redirect_helper,
name="canonical-redirect",
),
# Read-only view the published record for this concept. Render `400` response if record is not yet published.
path(
- 'v2///published/',
+ 'v2///published',
v2.CanonicalRecordPublished.as_view(),
name="canonical-published-detail",
),
diff --git a/app/admin_ui/views/change.py b/app/admin_ui/views/change.py
index 9f0b3768..7572f5c8 100644
--- a/app/admin_ui/views/change.py
+++ b/app/admin_ui/views/change.py
@@ -90,7 +90,6 @@ def get_queryset(self):
Change.objects.of_type(*self.models)
.filter(action=Change.Actions.CREATE)
.annotate(
- draft_uuid=Subquery(related_drafts.values("uuid")[:1]),
latest_status=Subquery(related_drafts.values("status")[:1]),
latest_action=Subquery(related_drafts.values("action")[:1]),
latest_updated_at=Subquery(related_drafts.values("updated_at")[:1]),
diff --git a/app/admin_ui/views/v2.py b/app/admin_ui/views/v2.py
index 54369e1a..e09727c6 100644
--- a/app/admin_ui/views/v2.py
+++ b/app/admin_ui/views/v2.py
@@ -39,7 +39,7 @@
# TODO add login requirement
-def redirect_helper(request, canonical_uuid, draft_uuid, model):
+def redirect_helper(request, canonical_uuid, model):
try:
has_progress_draft = (
Change.objects.exclude(status=Change.Statuses.PUBLISHED)
@@ -53,7 +53,6 @@ def redirect_helper(request, canonical_uuid, draft_uuid, model):
kwargs={
"canonical_uuid": canonical_uuid,
"model": model,
- "draft_uuid": draft_uuid,
},
)
)
@@ -104,7 +103,6 @@ def get_queryset(self):
)
)
.annotate(
- draft_uuid=Subquery(related_drafts.values("uuid")[:1]),
latest_status=Subquery(related_drafts.values("status")[:1]),
latest_action=Subquery(related_drafts.values("action")[:1]),
latest_updated_at=Subquery(related_drafts.values("updated_at")[:1]),
@@ -241,7 +239,6 @@ def get_success_url(self, **kwargs):
"canonical-redirect",
kwargs={
"canonical_uuid": self.kwargs[self.pk_url_kwarg],
- "draft_uuid": self.object.pk,
"model": self.kwargs["model"],
},
)
@@ -263,7 +260,6 @@ def get_context_data(self, **kwargs):
"descendents": context["object"].get_descendents().select_related("content_type"),
"comparison_form": self._get_comparison_form(context['model_form']),
"canonical_uuid": self.kwargs[self.pk_url_kwarg],
- "draft_uuid": self.object.pk,
}
def _get_comparison_form(self, model_form):
@@ -417,7 +413,6 @@ def get_context_data(self, **kwargs):
Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]).model_name.lower()
),
"display_name": Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]).model_name,
- "draft_uuid": self.object.pk,
}
def get_success_url(self):