1. Simone Marzola
  2. tgapp-tgcomments


Simone Marzola  committed ee6cff5

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

  • Participants
  • Parent commits 9f8d9e2
  • Branches default

Comments (0)

Files changed (1)

File tgcomments/controllers/root.py

View file
  • Ignore whitespace
 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):