Skip to content
Permalink
Browse files
fix #15 -- no caching
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 6, 2015
1 parent 961d151 commit 41715183e85d48f60fe2db5941080c029b977775
Showing with 9 additions and 2 deletions.
  1. +9 −2 COMET/__init__.py
@@ -84,16 +84,23 @@ def _author_uid_get(post):
u = post.meta['en']['author.uid']
return u if u else current_user.uid

def render(template_name, context=None):
def render(template_name, context=None, code=200, headers=None):
if context is None:
context = {}
if headers is None:
headers = {}

context['g'] = g
context['request'] = request
context['session'] = session
context['current_user'] = current_user
context['_author_get'] = _author_get
context['_author_uid_get'] = _author_uid_get
return _site.render_template(template_name, None, context)

headers['Pragma'] = 'no-cache'
headers['Cache-Control'] = 'private, max-age=0, no-cache'

return _site.render_template(template_name, None, context), code, headers

def unauthorized():
return redirect('/login?status=unauthorized')

0 comments on commit 4171518

Please sign in to comment.