Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 4233:01ef28bffcbd
don't show entire history by default
(fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540629)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 10 Aug 2009 02:02:00 +0000 |
| parents | 42331c201b02 |
| children | c5f52c2c9e36 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Mon Jul 27 23:57:23 2009 +0000 +++ b/roundup/cgi/templating.py Mon Aug 10 02:02:00 2009 +0000 @@ -880,7 +880,8 @@ # XXX do this return [] - def history(self, direction='descending', dre=re.compile('^\d+$')): + def history(self, direction='descending', dre=re.compile('^\d+$'), + limit=None): if not self.is_view_ok(): return self._('[hidden]') @@ -912,6 +913,10 @@ history.sort() history.reverse() + # restrict the volume + if limit: + history = history[:limit] + timezone = self._db.getUserTimezone() l = [] comments = {}
