changeset 2055:c8a8684efc74 beta

fixed issue #370
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 28 Feb 2012 01:37:20 +0200
parents 787f1d157984
children 851ea1139169
files docs/changelog.rst rhodecode/controllers/admin/repos_groups.py rhodecode/lib/utils.py
diffstat 3 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/docs/changelog.rst	Mon Feb 27 19:14:21 2012 +0200
+++ b/docs/changelog.rst	Tue Feb 28 01:37:20 2012 +0200
@@ -19,6 +19,7 @@
 
 - fixed git protocol issues with repos-groups
 - fixed git remote repos validator that prevented from cloning remote git repos
+- fixes #370 ending slashes fixes for repo and groups
 
 1.3.1 (**2012-02-27**)
 ----------------------
--- a/rhodecode/controllers/admin/repos_groups.py	Mon Feb 27 19:14:21 2012 +0200
+++ b/rhodecode/controllers/admin/repos_groups.py	Tue Feb 28 01:37:20 2012 +0200
@@ -263,6 +263,11 @@
             raise HTTPInternalServerError()
 
     def show_by_name(self, group_name):
+        """
+        This is a proxy that does a lookup group_name -> id, and shows
+        the group by id view instead
+        """
+        group_name = group_name.rstrip('/')
         id_ = RepoGroup.get_by_group_name(group_name).group_id
         return self.show(id_)
 
--- a/rhodecode/lib/utils.py	Mon Feb 27 19:14:21 2012 +0200
+++ b/rhodecode/lib/utils.py	Tue Feb 28 01:37:20 2012 +0200
@@ -92,11 +92,17 @@
 
 
 def get_repo_slug(request):
-    return request.environ['pylons.routes_dict'].get('repo_name')
+    _repo = request.environ['pylons.routes_dict'].get('repo_name')
+    if _repo:
+        _repo = _repo.rstrip('/')
+    return _repo
 
 
 def get_repos_group_slug(request):
-    return request.environ['pylons.routes_dict'].get('group_name')
+    _group = request.environ['pylons.routes_dict'].get('group_name')
+    if _group:
+        _group = _group.rstrip('/')
+    return _group
 
 
 def action_logger(user, action, repo, ipaddr='', sa=None, commit=False):