From 857bed41b8aa787166d6f2c4bb943512ebadd799 Mon Sep 17 00:00:00 2001 From: Dennis Schwertel Date: Tue, 19 Dec 2023 11:16:31 +0100 Subject: [PATCH 1/3] dependency test --- tests/requirements/requirements_base.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/requirements/requirements_base.txt b/tests/requirements/requirements_base.txt index d843b3e12..476db111c 100644 --- a/tests/requirements/requirements_base.txt +++ b/tests/requirements/requirements_base.txt @@ -6,10 +6,10 @@ flake8 isort lxml tox -djangocms-versioning==1.2.2 -djangocms-alias==1.11.0 -djangocms-references==1.4.1 -djangocms-version-locking==1.2.0 -django-cms==4.0.1.dev2 -djangocms-text-ckeditor==4.0.1.dev1 -djangocms-moderation==2.1.5 +https://github.com/django-cms/django-cms/tarball/develop-4#egg=django-cms +https://github.com/divio/djangocms-text-ckeditor/tarball/support/4.0.x#egg=djangocms-text-ckeditor +https://github.com/django-cms/djangocms-versioning/tarball/master#egg=djangocms-versioning +https://github.com/FidelityInternational/djangocms-version-locking/tarball/master#egg=djangocms-version-locking +https://github.com/django-cms/djangocms-moderation/tarball/master#egg=djangocms-moderation +https://github.com/FidelityInternational/djangocms-references/tarball/master#egg=djangocms-references +https://github.com/django-cms/djangocms-alias/tarball/master#egg=djangocms-alias From 2eaf66af4eb681a23d066768374cbe4540246a57 Mon Sep 17 00:00:00 2001 From: Evan-Pi Date: Mon, 15 Jan 2024 13:54:24 +0100 Subject: [PATCH 2/3] Update dependencies - Pin django-cms to version 4.0.0 - Pin djangocms-alias to version 1.11.0 - Pin djangocms-versioning to version 1.2.2 All of the above where required as they previously followed latest releases for which djangocms-navigation was incompatible with. --- setup.py | 2 +- tests/requirements/requirements_base.txt | 6 +++--- tox.ini | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 6572d8e55..a79dfab59 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ INSTALL_REQUIREMENTS = [ "Django>=1.11,<3.3", - "django-treebeard>=4.3", + "django-treebeard>=4.3,<4.6.0", "django-cms", ] diff --git a/tests/requirements/requirements_base.txt b/tests/requirements/requirements_base.txt index 476db111c..4e9da9c37 100644 --- a/tests/requirements/requirements_base.txt +++ b/tests/requirements/requirements_base.txt @@ -6,10 +6,10 @@ flake8 isort lxml tox -https://github.com/django-cms/django-cms/tarball/develop-4#egg=django-cms +https://github.com/django-cms/django-cms/tarball/4.0.0#egg=django-cms https://github.com/divio/djangocms-text-ckeditor/tarball/support/4.0.x#egg=djangocms-text-ckeditor -https://github.com/django-cms/djangocms-versioning/tarball/master#egg=djangocms-versioning +https://github.com/django-cms/djangocms-versioning/tarball/1.2.2#egg=djangocms-versioning https://github.com/FidelityInternational/djangocms-version-locking/tarball/master#egg=djangocms-version-locking https://github.com/django-cms/djangocms-moderation/tarball/master#egg=djangocms-moderation https://github.com/FidelityInternational/djangocms-references/tarball/master#egg=djangocms-references -https://github.com/django-cms/djangocms-alias/tarball/master#egg=djangocms-alias +https://github.com/django-cms/djangocms-alias/tarball/1.11.0#egg=djangocms-alias diff --git a/tox.ini b/tox.ini index 72e50f766..77efdb657 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = flake8 isort - py{37,38,39}-dj{22}-sqlite-cms40 + py{37,38,39}-dj{22,32}-sqlite-cms40 skip_missing_interpreters=True From 654401dadc612bbc7cede7fb960229aaac0deae3 Mon Sep 17 00:00:00 2001 From: Evan-Pi Date: Fri, 26 Jan 2024 19:02:16 +0100 Subject: [PATCH 3/3] Fix bug on unpublished pages filtering logic It seems like page.get_title_obj().versions.first() can be of type NoneType which is something that we need to take into account when trying to access its state attribute. --- djangocms_navigation/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/djangocms_navigation/views.py b/djangocms_navigation/views.py index 91be896ce..da82566c0 100644 --- a/djangocms_navigation/views.py +++ b/djangocms_navigation/views.py @@ -37,7 +37,9 @@ def get(self, request, *args, **kwargs): # Removing unpublished pages from queryset if model == Page: queryset_data = [ - page for page in queryset_data if page.get_title_obj().versions.first().state != 'unpublished' + page for page in queryset_data + if getattr(page.get_title_obj().versions.first(), "state", None) + != 'unpublished' ] data = {