This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8424
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 2b7531c3af2d8beb2bf68b3ea805805813816eb5
Author: Guillermo Cruz <[email protected]>
AuthorDate: Tue Apr 5 14:55:24 2022 -0600

    [#8424] fix for invalid discussion version values in url params
---
 Allura/allura/controllers/discuss.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/controllers/discuss.py 
b/Allura/allura/controllers/discuss.py
index a22c7a36a..0b0360d46 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -343,7 +343,9 @@ class PostController(BaseController, 
metaclass=h.ProxiedAttrMeta):
                 ss = HC.query.find(
                     {'artifact_id': self.post._id, 'version': 
int(version)}).first()
                 if not ss:
-                    raise exc.HTTPNotFound
+                    url = 
'/p/{}/discussion/{}/thread/{}/{}'.format(c.project.shortname, 
c.forum.shortname,
+                                                                    
self.thread._id, self._post_slug)
+                    utils.permanent_redirect(url)
 
                 class VersionedSnapshotTempObject(Object):
                     pass

Reply via email to