Skip to content

Commit

Permalink
fixing django cms handle no page - redirect to fallback urls
Browse files Browse the repository at this point in the history
  • Loading branch information
vasekch committed Jan 23, 2024
1 parent 40a3f72 commit 04c5c83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cms/page_rendering.py
Expand Up @@ -55,12 +55,10 @@ def render_page(request, page, current_language, slug):
def _handle_no_page(request):
try:
# add a $ to the end of the url (does not match on the cms anymore)
resolve('%s$' % request.path)
return resolve('%s$' % request.path).func(request)
except Resolver404 as e:
# raise a django http 404 page
exc = Http404(dict(path=request.path, tried=e.args[0]['tried']))
raise exc
raise Http404('CMS Page not found: %s' % request.path)
raise Http404(dict(path=request.path, tried=e.args[0]['tried']))


def _handle_no_apphook(request):
Expand Down
2 changes: 1 addition & 1 deletion cms/views.py
Expand Up @@ -116,7 +116,7 @@ def details(request, slug):

if not page:
# raise 404
_handle_no_page(request)
return _handle_no_page(request)

request.current_page = page

Expand Down

0 comments on commit 04c5c83

Please sign in to comment.