allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [20/26] allura git commit: Force trailing slash on merge request URLs, so form submit goes to right place
Date Fri, 27 Feb 2015 12:50:53 GMT
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/ib/7830
Commit: 55cd10b65bc2a247c210fbbaa85b8b4df2507f61
Parents: 9f832dd
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Feb 25 15:36:46 2015 +0000
Committer: Dave Brondsema <dbrondsema@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')


Mime
View raw message