changeset 1609:aaabec656ceb beta

fixed xhr check for tags-branches view
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 29 Oct 2011 01:40:14 +0200
parents 0069657aaf42
children 277690a23606
files rhodecode/controllers/home.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/home.py	Sat Oct 29 00:57:09 2011 +0200
+++ b/rhodecode/controllers/home.py	Sat Oct 29 01:40:14 2011 +0200
@@ -24,7 +24,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import logging
-from operator import itemgetter
 
 from pylons import tmpl_context as c, request
 from paste.httpexceptions import HTTPBadRequest
@@ -60,10 +59,10 @@
             return HTTPBadRequest()
 
     def branch_tag_switcher(self, repo_name):
-        c.rhodecode_db_repo = Repository.get_by_repo_name(c.repo_name)
-        c.rhodecode_repo = c.rhodecode_db_repo.scm_instance
-        return render('/switch_to_list.html')
         if request.is_xhr:
+            c.rhodecode_db_repo = Repository.get_by_repo_name(c.repo_name)
+            c.rhodecode_repo = c.rhodecode_db_repo.scm_instance
             return render('/switch_to_list.html')
         else:
             return HTTPBadRequest()
+