From 0088fc6ff4d4b1541c258c23c85a8027b4a3e141 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Fri, 11 Oct 2024 11:19:54 +0200 Subject: [PATCH] fix(apis_entities): correct merge link The merge link was incorrectly pointing the merge action view that merges two objects; it has been corrected to point to the merge view that allows the user to select another object for merging. closes #1278 --- apis_core/apis_entities/models.py | 7 +++++++ .../apis_entities/partials/entity_actions_nav.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apis_core/apis_entities/models.py b/apis_core/apis_entities/models.py index 2a073032a..3e4286c8c 100644 --- a/apis_core/apis_entities/models.py +++ b/apis_core/apis_entities/models.py @@ -84,6 +84,13 @@ def get_duplicate_url(self): kwargs={"contenttype": entity, "pk": self.id}, ) + def get_merge_view_url(self): + entity = self.__class__.__name__.lower() + return reverse( + "apis_core:apis_entities:generic_entities_merge_view", + kwargs={"contenttype": entity, "pk": self.id}, + ) + def merge_start_date_written(self, other): self.start_date_written = self.start_date_written or other.start_date_written diff --git a/apis_core/apis_entities/templates/apis_entities/partials/entity_actions_nav.html b/apis_core/apis_entities/templates/apis_entities/partials/entity_actions_nav.html index eb33c9c64..929a69c12 100644 --- a/apis_core/apis_entities/templates/apis_entities/partials/entity_actions_nav.html +++ b/apis_core/apis_entities/templates/apis_entities/partials/entity_actions_nav.html @@ -17,7 +17,7 @@ + href="{{ object.get_merge_view_url }}"> cell_merge Merge {% endif %}