changeset 211:a3a7c3e03b76 rhodecode-0.0.0.7.3

version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 24 May 2010 00:58:26 +0200
parents 6257cf277395
children 671931f082c3
files pylons_app/__init__.py pylons_app/controllers/changelog.py
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/__init__.py	Sun May 23 21:27:07 2010 +0200
+++ b/pylons_app/__init__.py	Mon May 24 00:58:26 2010 +0200
@@ -2,7 +2,7 @@
 Hg app, a web based mercurial repository managment based on pylons
 """
 
-VERSION = (0, 7, 2, 'beta')
+VERSION = (0, 7, 3, 'beta')
 
 __version__ = '.'.join((str(each) for each in VERSION[:4]))
 
--- a/pylons_app/controllers/changelog.py	Sun May 23 21:27:07 2010 +0200
+++ b/pylons_app/controllers/changelog.py	Mon May 24 00:58:26 2010 +0200
@@ -1,4 +1,3 @@
-from beaker.cache import cache_region
 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
 from mercurial.node import short
 from pylons import request, response, session, tmpl_context as c, url, config, \
@@ -7,8 +6,6 @@
 from pylons_app.lib.auth import LoginRequired
 from pylons_app.lib.base import BaseController, render, _full_changelog_cached
 from pylons_app.lib.filters import age as _age, person
-from pylons_app.lib.utils import get_repo_slug
-from pylons_app.model.hg_model import HgModel
 from simplejson import dumps
 from webhelpers.paginate import Page
 import logging
@@ -22,11 +19,18 @@
                 
     def index(self):
         if request.params.get('size'):
-            c.size = int(request.params['size'])
+            limit = 100
+            default = 20
+            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 = session.get('changelog_size', 20)
+            c.size = session.get('changelog_size', default)
 
         changesets = _full_changelog_cached(c.repo_name)