incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6381] ticket:491 fixed reply error
Date Tue, 10 Dec 2013 18:21:14 GMT
Updated Branches:
  refs/heads/master 9a0faf0de -> fcf2e4659


[#6381] ticket:491 fixed reply error

If a reply violates the antispam protection (e.g. form had been open > 24hr)
then previously the index method would "handle" the error and mark the parent
message as edited.  This prevents that.


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/fcf2e465
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fcf2e465
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fcf2e465

Branch: refs/heads/master
Commit: fcf2e465939e947bfee9a9b85811e32f14161527
Parents: 9a0faf0
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Sun Dec 1 01:06:20 2013 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Dec 10 18:20:22 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fcf2e465/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index 74879ad..b80b4e9 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -186,10 +186,13 @@ class ThreadController(BaseController, FeedController):
                     limit=int(limit),
                     show_moderate=kw.get('show_moderate'))
 
+    def error_handler(self, *args, **kwargs):
+        redirect(request.referer)
+
     @h.vardec
     @expose()
     @require_post()
-    @validate(pass_validator, error_handler=index)
+    @validate(pass_validator, error_handler=error_handler)
     @utils.AntiSpam.validate('Spambot protection engaged')
     def post(self, **kw):
         require_access(self.thread, 'post')
@@ -310,10 +313,13 @@ class PostController(BaseController):
             return dict(discussion=self.post.discussion,
                         post=post)
 
+    def error_handler(self, *args, **kwargs):
+        redirect(request.referer)
+
     @h.vardec
     @expose()
     @require_post()
-    @validate(pass_validator, error_handler=index)
+    @validate(pass_validator, error_handler=error_handler)
     @utils.AntiSpam.validate('Spambot protection engaged')
     @require_post(redir='.')
     def reply(self, file_info=None, **kw):
@@ -326,7 +332,7 @@ class PostController(BaseController):
     @h.vardec
     @expose()
     @require_post()
-    @validate(pass_validator, error_handler=index)
+    @validate(pass_validator, error_handler=error_handler)
     def moderate(self, **kw):
         require_access(self.post.thread, 'moderate')
         if kw.pop('delete', None):
@@ -342,7 +348,7 @@ class PostController(BaseController):
     @h.vardec
     @expose()
     @require_post()
-    @validate(pass_validator, error_handler=index)
+    @validate(pass_validator, error_handler=error_handler)
     def flag(self, **kw):
         self.W.flag_post.to_python(kw, None)
         if c.user._id not in self.post.flagged_by:


Mime
View raw message