Changeset - 4548912f48c8
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-07-18 17:59:51
marcin@python-works.com
fixes issue #502, float division error on setting maxsize of changelog to 0
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -55,25 +55,26 @@ class ChangelogController(BaseRepoContro
 
        default = 20
 
        if request.params.get('size'):
 
            try:
 
                int_size = int(request.params.get('size'))
 
            except ValueError:
 
                int_size = default
 
            int_size = int_size if int_size <= limit else limit
 
            c.size = int_size
 
            session['changelog_size'] = c.size
 
            session.save()
 
        else:
 
            c.size = int(session.get('changelog_size', default))
 

	
 
        # min size must be 1
 
        c.size = max(c.size, 1)
 
        p = int(request.params.get('page', 1))
 
        branch_name = request.params.get('branch', None)
 
        try:
 
            if branch_name:
 
                collection = [z for z in
 
                              c.rhodecode_repo.get_changesets(start=0,
 
                                                    branch_name=branch_name)]
 
                c.total_cs = len(collection)
 
            else:
 
                collection = c.rhodecode_repo
 
                c.total_cs = len(c.rhodecode_repo)
 

	
0 comments (0 inline, 0 general)