Commits

Simone Marzola  committed ee6cff5

redirect to host_url when the vote request has the referer header empty

  • Participants
  • Parent commits 9f8d9e2

Comments (0)

Files changed (1)

File tgcomments/controllers/root.py

 def back_to_referer(*args, **kw):
     if not kw.get('success'):
         flash('Failed to post comment', 'error')
-    raise redirect(request.referer)
+    if request.referer is not None:
+        raise redirect(request.referer)
+    raise redirect(request.host_url)
 
 class RootController(TGController):
     @expose()