changeset 338:1eb2267a5469

fixed bug when, sortables have wrong value
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 06 Jul 2010 23:50:53 +0200
parents fa3835d34fc1
children 5d517bbf0a0d
files pylons_app/controllers/hg.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/controllers/hg.py	Tue Jul 06 23:47:28 2010 +0200
+++ b/pylons_app/controllers/hg.py	Tue Jul 06 23:50:53 2010 +0200
@@ -39,8 +39,12 @@
     def index(self):
         c.current_sort = request.GET.get('sort', 'name')
         cs = c.current_sort
+        sortables = ['name', 'description', 'last_change', 'tip', 'contact']
+        
+        if cs not in sortables:
+            cs = 'name'
         c.cs_slug = cs.replace('-', '')
-        sortables = ['name', 'description', 'last_change', 'tip', 'contact']
+        
         cached_repo_list = HgModel().get_repos()
         if cs and c.cs_slug in sortables:
             sort_key = c.cs_slug + '_sort'