diff --git a/poetry.lock b/poetry.lock index 87f90a27a..051ee8737 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1293,14 +1293,21 @@ django = "*" [[package]] name = "django-simple-history" -version = "3.4.0" +version = "0.0.post1304+g29108a5" description = "Store model history and view/revert changes from admin site." optional = false python-versions = ">=3.8" -files = [ - {file = "django-simple-history-3.4.0.tar.gz", hash = "sha256:19bd1a87e1e2eba34dfd43eab1fcf2da5752221f343232f2372b2121c7e3b97d"}, - {file = "django_simple_history-3.4.0-py3-none-any.whl", hash = "sha256:992dcca3cddc0b67b470fc91f77292e2d2a6010d37c9eac3536e9d80e8754032"}, -] +files = [] +develop = false + +[package.dependencies] +asgiref = ">=3.6" + +[package.source] +type = "git" +url = "https://github.com/uktrade/django-simple-history.git" +reference = "29108a5" +resolved_reference = "29108a5b94397ba6107e6899db957289c75468c1" [[package]] name = "django-staff-sso-client" @@ -4376,4 +4383,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "c1c0650622b9db0ad2a1455780d13d47c8a2f10de3eec791700ae61de6440cd0" +content-hash = "d131c2eee71bd55f9c5773b9e4b6a0b28cea9a9f4ac70ae7c3e9653a367aeb31" diff --git a/pyproject.toml b/pyproject.toml index d67d98b82..539cad3f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,8 @@ django-crispy-forms = "^1.14.0" django-environ = "^0.10.0" # django_redis = "^5.2.0" django-settings-export = "^1.2.1" -django-simple-history = "^3.3.0" +# TODO: Set django-simple-history to the next release after 3.4.0 (when released) +django-simple-history = { git = "https://github.com/uktrade/django-simple-history.git", rev = "29108a5" } django-storages = "^1.13.2" django-webpack-loader = "^1.8.1" djangorestframework = "^3.14.0" diff --git a/requirements.txt b/requirements.txt index 30caf7517..93ac2d069 100644 --- a/requirements.txt +++ b/requirements.txt @@ -40,7 +40,7 @@ django-log-formatter-ecs==0.0.5 ; python_version >= "3.11" and python_version < django-modelcluster==6.1 ; python_version >= "3.11" and python_version < "4.0" django-permissionedforms==0.1 ; python_version >= "3.11" and python_version < "4.0" django-settings-export==1.2.1 ; python_version >= "3.11" and python_version < "4.0" -django-simple-history==3.4.0 ; python_version >= "3.11" and python_version < "4.0" +django-simple-history @ git+https://github.com/uktrade/django-simple-history.git@29108a5 ; python_version >= "3.11" and python_version < "4.0" django-staff-sso-client==4.2.1 ; python_version >= "3.11" and python_version < "4.0" django-storages==1.14.2 ; python_version >= "3.11" and python_version < "4.0" django-taggit==3.1.0 ; python_version >= "3.11" and python_version < "4.0" diff --git a/src/working_at_dit/models.py b/src/working_at_dit/models.py index 135afc64d..ae509d0fd 100644 --- a/src/working_at_dit/models.py +++ b/src/working_at_dit/models.py @@ -36,14 +36,14 @@ def get_context(self, request, *args, **kwargs): context = super().get_context(request, *args, **kwargs) context["related_news"] = PageTopic.objects.filter( - topic=self.contentpage, page__content_type__app_label="news" + topic=self, page__content_type__app_label="news" ).order_by("-page__last_published_at")[:5] context["policies_and_guidance"] = ( ContentPage.objects.public() .live() .filter( - topics__topic=self.contentpage, + topics__topic=self, content_type__app_label="working_at_dit", ) .filter(Q(content_type__model="policy") | Q(content_type__model="guidance")) @@ -51,13 +51,13 @@ def get_context(self, request, *args, **kwargs): ) tools = PageTopic.objects.filter( - topic=self.contentpage, page__content_type__app_label="tools" + topic=self, page__content_type__app_label="tools" ).order_by("page__last_published_at") context["tools"] = tools how_do_is = PageTopic.objects.filter( - topic=self.contentpage, + topic=self, page__content_type__app_label="working_at_dit", page__content_type__model="howdoi", page__live=True,