changeset 3550:65eac5f65a11

Page.edit_info: better return empty dict than None when no edit-log entry is found
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 03 May 2008 19:26:18 +0200
parents 56b476878a1c
children a8acceca815a
files MoinMoin/Page.py MoinMoin/_tests/test_Page.py MoinMoin/search/Xapian.py
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat May 03 18:20:44 2008 +0200
+++ b/MoinMoin/Page.py	Sat May 03 19:26:18 2008 +0200
@@ -561,7 +561,7 @@
             }
             del line
         else:
-            result = None
+            result = {}
         return result
 
     def last_edit(self, request):
--- a/MoinMoin/_tests/test_Page.py	Sat May 03 18:20:44 2008 +0200
+++ b/MoinMoin/_tests/test_Page.py	Sat May 03 19:26:18 2008 +0200
@@ -38,7 +38,7 @@
         # thus edit_info will return None
         page = Page(self.request, u'RecentChanges')
         edit_info = page.edit_info()
-        assert edit_info is None
+        assert edit_info == {}
 
     def testSplitTitle(self):
         page = Page(self.request, u"FrontPage")
--- a/MoinMoin/search/Xapian.py	Sat May 03 18:20:44 2008 +0200
+++ b/MoinMoin/search/Xapian.py	Sat May 03 19:26:18 2008 +0200
@@ -463,7 +463,7 @@
         mtime = page.mtime_usecs()
         revision = str(page.get_real_rev())
         itemid = "%s:%s:%s" % (wikiname, pagename, revision)
-        author = page.edit_info()['editor']
+        author = page.edit_info().get('editor', '?')
         # XXX: Hack until we get proper metadata
         language, stem_language = self._get_languages(page)
         categories = self._get_categories(page)