You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/02/26 09:09:51 UTC

allura git commit: Force trailing slash on merge request URLs, so form submit goes to right place

Repository: allura
Updated Branches:
  refs/heads/master 9f832dd5f -> 55cd10b65


Force trailing slash on merge request URLs, so form submit goes to right place


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

Branch: refs/heads/master
Commit: 55cd10b65bc2a247c210fbbaa85b8b4df2507f61
Parents: 9f832dd
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Feb 25 15:36:46 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Feb 25 15:36:46 2015 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py                | 1 +
 ForgeGit/forgegit/tests/functional/test_controllers.py | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/55cd10b6/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 1751839..1e1e840 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -354,6 +354,7 @@ class MergeRequestController(object):
         if self.req is None:
             raise exc.HTTPNotFound
 
+    @with_trailing_slash
     @expose('jinja:allura:templates/repo/merge_request.html')
     def index(self, page=0, limit=250, **kw):
         c.thread = self.thread_widget

http://git-wip-us.apache.org/repos/asf/allura/blob/55cd10b6/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 632cad5..c048599 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -542,6 +542,11 @@ class TestFork(_TestCase):
         assert 'git merge {}'.format(c_id) in merge_instructions
         assert_in('less than 1 minute ago', r.html.findAll('p')[0].getText())
 
+    def test_merge_request_detail_noslash(self):
+        self._request_merge()
+        r = self.app.get('/p/test/src-git/merge-requests/1', status=302)
+        assert_equal(r.location, 'http://localhost/p/test/src-git/merge-requests/1/')
+
     def test_merge_request_with_deleted_repo(self):
         self._request_merge()
         h.set_context('test2', 'code', neighborhood='Projects')