diff pylons_app/controllers/hg.py @ 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 3782a6d698af
children 07f50e9b308f
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'