changeset 768:9375b8a6a188 pytest2

fix crash when user bookmark is None
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 24 Aug 2011 18:17:35 +0200
parents bb3ea5043a4f
children 813802d5072a
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Tue Aug 23 21:53:27 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Wed Aug 24 18:17:35 2011 +0200
@@ -701,12 +701,13 @@
 @frontend.route('/+history')
 def global_history():
     history = flaskg.storage.history(item_name='')
+    bookmark_time = None
     results_per_page = int(app.cfg.results_per_page)
     if flaskg.user.valid:
-        bookmark_time = flaskg.user.getBookmark()
+        bm = flaskg.user.getBookmark()
+        if bm is not None:
+            bookmark_time = datetime.utcfromtimestamp(bm)
         results_per_page = flaskg.user.results_per_page # if it is 0, means no paging
-    else:
-        bookmark_time = None
     item_groups = OrderedDict()
     for rev in history:
         current_item_name = rev.item.name