99from feincms ._internal import get_model
1010from feincms .module .mixins import ContentView
1111
12+
1213logger = logging .getLogger (__name__ )
1314
15+
1416class Handler (ContentView ):
1517 page_model_path = None
1618 context_object_name = 'feincms_page'
@@ -32,21 +34,27 @@ def dispatch(self, request, *args, **kwargs):
3234 return super (Handler , self ).dispatch (request , * args , ** kwargs )
3335 except Http404 as e :
3436 if settings .FEINCMS_CMS_404_PAGE is not None :
35- logger .info ("Http404 raised for '%s', attempting redirect to FEINCMS_CMS_404_PAGE" , args [0 ])
37+ logger .info (
38+ "Http404 raised for '%s', attempting redirect to"
39+ " FEINCMS_CMS_404_PAGE" , args [0 ])
3640 try :
37- # Fudge environment so that we end up resolving the right page.
38- # Note: request.path is used by the page redirect processor to
39- # determine if the redirect can be taken, must be == to page url
41+ # Fudge environment so that we end up resolving the right
42+ # page.
43+ # Note: request.path is used by the page redirect processor
44+ # to determine if the redirect can be taken, must be == to
45+ # page url
4046 request .path = settings .FEINCMS_CMS_404_PAGE
4147 response = super (Handler , self ).dispatch (
4248 request , settings .FEINCMS_CMS_404_PAGE , ** kwargs )
43- # Only set status if we actually have a page. If we get
44- # for example a redirect, overwriting would yield a blank page
49+ # Only set status if we actually have a page. If we get for
50+ # example a redirect, overwriting would yield a blank page
4551 if response .status_code == 200 :
4652 response .status_code = 404
4753 return response
4854 except Http404 :
49- logger .error ("Http404 raised while resolving FEINCMS_CMS_404_PAGE=%s" ,
55+ logger .error (
56+ "Http404 raised while resolving"
57+ " FEINCMS_CMS_404_PAGE=%s" ,
5058 settings .FEINCMS_CMS_404_PAGE )
5159 raise e
5260 else :
0 commit comments