def _makeOne(self, **kw): from pyramid.view import notfound_view_config return notfound_view_config(**kw)
return privileges else: return [] else: return [] forbidden_view_config() def forbidden(request): browser_error = checkBrowser(request) device_error = checkDevice(request) path = request.path from pyramid.response import Response return render_to_response('forbidden.mak', {'path':path,'login':'', 'browser_error':browser_error, 'device_error':device_error}, request=request) notfound_view_config() def notfound(request): browser_error = checkBrowser(request) device_error = checkDevice(request) path = request.path from pyramid.response import Response return render_to_response('notfound.mak', {'path':path,'login':'', 'browser_error':browser_error, 'device_error':device_error}, request=request) def checkBrowser(request): user_agent = httpagentparser.detect(request.user_agent) browser_error = False if user_agent['browser']['name'] != 'Chrome' and user_agent['browser']['name'] != 'Firefox': browser_error = True return browser_error def checkDevice(request):