Changeset - 1eb2267a5469
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-07-06 23:50:53
marcin@python-works.com
fixed bug when, sortables have wrong value
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/hg.py
Show inline comments
 
@@ -36,14 +36,18 @@ class HgController(BaseController):
 
    def __before__(self):
 
        super(HgController, self).__before__()
 
        
 
    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'
 
            if cs.startswith('-'):
 
                c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=True)
 
            else:
0 comments (0 inline, 0 general)