Skip to content

Commit

Permalink
Merge 6813f21 into f35e83a
Browse files Browse the repository at this point in the history
  • Loading branch information
execut committed May 18, 2021
2 parents f35e83a + 6813f21 commit 6213649
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Unreleased
* Remove debug print from apphook_reload
* Enforce use of coverage > 4 for python 3.8 support
* Fixed 66622 bad Title.path in multilingual sites when parent slug is created or modified
* Improved performance of ``cms list plugins`` command
* Fixed 6973 bag with unexpected behavior ``get_page_from_request``
* Temporarily pinned django-treebeard to < 4.5, this avoids breaking changes introduced
* Improved performance of ``cms list plugins`` command
* Fix styles issues, caused by switching to the ``display: flex`` on the page tree renderer.
* Added django-treebeard 4.5.1 support, previously pinned django-treebeard<4.5 to avoid breaking changes introduced
* Updated documentation links
Expand Down
6 changes: 6 additions & 0 deletions cms/tests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,12 @@ def test_get_page_without_final_slash(self):
self.assertIsNotNone(found_page)
self.assertFalse(found_page.publisher_is_draft)

def test_get_page_from_request_without_cache_when_has_use_path_argument(self):
request = self.get_request('/test')
request._current_page_cache = True
found_page = get_page_from_request(request, 'page_path')
self.assertIsNone(found_page)

def test_ancestor_expired(self):
yesterday = tz_now() - datetime.timedelta(days=1)
tomorrow = tz_now() + datetime.timedelta(days=1)
Expand Down
2 changes: 1 addition & 1 deletion cms/utils/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_page_from_request(request, use_path=None, clean_path=None):
"""
from cms.utils.page_permissions import user_can_view_page_draft

if hasattr(request, '_current_page_cache'):
if not bool(use_path) and hasattr(request, '_current_page_cache'):
# The following is set by CurrentPageMiddleware
return request._current_page_cache

Expand Down

0 comments on commit 6213649

Please sign in to comment.