misc: add required parameter when native 404 is called explicitely (#61816)
This commit is contained in:
parent
749bcddd8f
commit
07d52f797c
|
@ -584,6 +584,9 @@ def publish_page(request, page, status=200, template_name=None):
|
|||
|
||||
|
||||
def error404(request, *args, **kwargs):
|
||||
if not args and 'exception' not in kwargs:
|
||||
# happens when /404 is called on portal agent
|
||||
kwargs['exception'] = Exception()
|
||||
if not hasattr(request, 'user'):
|
||||
# this happens when the 404 handler is called early on, for example
|
||||
# when the given hostname doesn't exist as a tenant
|
||||
|
|
|
@ -555,6 +555,9 @@ def test_404(app):
|
|||
assert 'Custom 404 Text' not in resp.text
|
||||
assert "This page doesn't exist" not in resp.text
|
||||
|
||||
# check access using its /404/ slug
|
||||
resp = app.get('/404', status=404)
|
||||
|
||||
# check 404 skeleton when all pages are private
|
||||
resp = app.get('/__skeleton__/?source=404')
|
||||
assert 'Custom 404 Text' not in resp.text
|
||||
|
|
Loading…
Reference in New Issue