changeset 3040:ec483ce69ad9 beta

added global fix for stripping multiple slashes from f_path variable
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 28 Nov 2012 01:34:59 +0100
parents a520d542697e
children a41f0f978185
files rhodecode/config/routing.py rhodecode/controllers/shortlog.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/config/routing.py	Wed Nov 28 01:27:21 2012 +0100
+++ b/rhodecode/config/routing.py	Wed Nov 28 01:34:59 2012 +0100
@@ -32,6 +32,10 @@
         from rhodecode.model.db import Repository
         repo_name = match_dict.get('repo_name')
 
+        if match_dict.get('f_path'):
+            #fix for multiple initial slashes that causes errors
+            match_dict['f_path'] = match_dict['f_path'].lstrip('/')
+
         try:
             by_id = repo_name.split('_')
             if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '':
--- a/rhodecode/controllers/shortlog.py	Wed Nov 28 01:27:21 2012 +0100
+++ b/rhodecode/controllers/shortlog.py	Wed Nov 28 01:34:59 2012 +0100
@@ -73,7 +73,6 @@
         collection = c.rhodecode_repo
         c.file_history = f_path
         if f_path:
-            f_path = f_path.lstrip('/')
             # get the history for the file !
             tip_cs = c.rhodecode_repo.get_changeset()
             try: