Browse Source

Vhled je dělaný přes context processor, mažu middleware

v3
Jonas Havelka 1 year ago
parent
commit
bbaf109bbe
  1. 34
      mamweb/middleware.py

34
mamweb/middleware.py

@ -52,37 +52,3 @@ class LoggedInHintCookieMiddleware(object):
if self.cookie_name in request.COOKIES: if self.cookie_name in request.COOKIES:
response.delete_cookie(self.cookie_name) response.delete_cookie(self.cookie_name)
return response return response
class vzhled:
def process_request(self, request):
return None
def process_view(self, request, view_func, view_args, view_kwargs):
#print "====== process_request ======"
#print view_func
#print view_args
#print view_kwargs
#print "============================="
return None
def process_template_response(self, request, response):
hodin = datetime.now().hour
if (hodin <= 6) or (hodin >= 14): # TODO 20
response.context_data['noc'] = True
else:
response.context_data['noc'] = False
return response
def process_response(self, request, response):
#hodin = datetime.now().hour
#if (hodin <= 6) or (hodin >= 14): # TODO 20
#response.context_data['noc'] = True
#else:
#response.context_data['noc'] = False
return response
##def process_exception(request, exception):
#pass

Loading…
Cancel
Save