Skip to content

Commit

Permalink
fix #15 -- no caching
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 6, 2015
1 parent 961d151 commit 4171518
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions COMET/__init__.py
Expand Up @@ -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')
Expand Down

0 comments on commit 4171518

Please sign in to comment.