diff rhodecode/controllers/admin/notifications.py @ 2854:d998cc84cf72 rhodecode-0.0.1.4.2

Merge branch beta into stable
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 19 Sep 2012 22:38:12 +0200
parents 6b176c679896
children a45191e7c7bb
line wrap: on
line diff
--- a/rhodecode/controllers/admin/notifications.py	Sat Sep 08 00:39:00 2012 +0200
+++ b/rhodecode/controllers/admin/notifications.py	Wed Sep 19 22:38:12 2012 +0200
@@ -39,6 +39,7 @@
 from rhodecode.lib.auth import LoginRequired, NotAnonymous
 from rhodecode.lib import helpers as h
 from rhodecode.model.meta import Session
+from rhodecode.lib.utils2 import safe_int
 
 
 log = logging.getLogger(__name__)
@@ -62,7 +63,8 @@
         c.user = self.rhodecode_user
         notif = NotificationModel().get_for_user(self.rhodecode_user.user_id,
                                             filter_=request.GET.getall('type'))
-        p = int(request.params.get('page', 1))
+
+        p = safe_int(request.params.get('page', 1), 1)
         c.notifications = Page(notif, page=p, items_per_page=10)
         c.pull_request_type = Notification.TYPE_PULL_REQUEST
         c.comment_type = [Notification.TYPE_CHANGESET_COMMENT,