From 592de1d454a77f0530ac2933e4a76cfbcfa9578d Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Tue, 7 May 2024 09:36:10 +0200 Subject: [PATCH] fix(history): rename `change_history` to `history` Closes: #802 --- apis_core/history/models.py | 2 +- .../templates/history/{change_history.html => history.html} | 0 apis_core/history/urls.py | 6 +++--- apis_core/history/views.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename apis_core/history/templates/history/{change_history.html => history.html} (100%) diff --git a/apis_core/history/models.py b/apis_core/history/models.py index f7d3d1f1e..d53059db7 100644 --- a/apis_core/history/models.py +++ b/apis_core/history/models.py @@ -155,7 +155,7 @@ def delete(self, *args, **kwargs) -> tuple[int, dict[str, int]]: def get_history_url(self): ct = ContentType.objects.get_for_model(self) - return reverse("apis_core:history:change_history", args=[ct, self.id]) + return reverse("apis_core:history:history", args=[ct, self.id]) def get_create_version_url(self): ct = ContentType.objects.get_for_model(self) diff --git a/apis_core/history/templates/history/change_history.html b/apis_core/history/templates/history/history.html similarity index 100% rename from apis_core/history/templates/history/change_history.html rename to apis_core/history/templates/history/history.html diff --git a/apis_core/history/urls.py b/apis_core/history/urls.py index 548d9d3d9..553f293be 100644 --- a/apis_core/history/urls.py +++ b/apis_core/history/urls.py @@ -11,9 +11,9 @@ urlpatterns = [ path( - "change_history///", - views.ChangeHistoryView.as_view(), - name="change_history", + "//history", + views.HistoryView.as_view(), + name="history", ), path( "add_new_version///", diff --git a/apis_core/history/views.py b/apis_core/history/views.py index d62d95073..7941158a4 100644 --- a/apis_core/history/views.py +++ b/apis_core/history/views.py @@ -10,8 +10,8 @@ from .tables import HistoryGenericTable -class ChangeHistoryView(GenericModelMixin, SingleTableMixin, DetailView): - template_name = "history/change_history.html" +class HistoryView(GenericModelMixin, SingleTableMixin, DetailView): + template_name = "history/history.html" def get_table_class(self): table_modules = module_paths(self.model, path="tables", suffix="HistoryTable")