kopia lustrzana https://github.com/wagtail/wagtail
rodzic
0b8fab6f42
commit
060219ee48
|
@ -6,11 +6,10 @@ class RouteResult(object):
|
|||
a Page instance that we will call serve(*args, **kwargs) on, rather
|
||||
than a view function.
|
||||
"""
|
||||
def __init__(self, page, view=None, args=None, kwargs=None):
|
||||
def __init__(self, page, args=None, kwargs=None):
|
||||
self.page = page
|
||||
self.args = args or []
|
||||
self.kwargs = kwargs or {}
|
||||
self.view = view or page.serve
|
||||
|
||||
def __getitem__(self, index):
|
||||
return (self.page, self.view, self.args, self.kwargs)[index]
|
||||
return (self.page, self.args, self.kwargs)[index]
|
||||
|
|
|
@ -25,13 +25,13 @@ def serve(request, path):
|
|||
)
|
||||
return route_result
|
||||
|
||||
(page, view, args, kwargs) = route_result
|
||||
(page, args, kwargs) = route_result
|
||||
for fn in hooks.get_hooks('before_serve_page'):
|
||||
result = fn(page, request, args, kwargs)
|
||||
if isinstance(result, HttpResponse):
|
||||
return result
|
||||
|
||||
return view(request, *args, **kwargs)
|
||||
return page.serve(request, *args, **kwargs)
|
||||
|
||||
|
||||
def authenticate_with_password(request, page_view_restriction_id, page_id):
|
||||
|
|
Ładowanie…
Reference in New Issue