changeset 4933:c8be59640927

action revert: avoids reverting to a deleted current revision
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 03 Aug 2009 23:00:31 +0200
parents 4c142c453f11
children efd8087a3062
files MoinMoin/action/revert.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/revert.py	Thu Jul 30 21:02:07 2009 +0200
+++ b/MoinMoin/action/revert.py	Mon Aug 03 23:00:31 2009 +0200
@@ -9,6 +9,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 from MoinMoin import wikiutil
+from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
 from MoinMoin.action import ActionBase
 
@@ -36,7 +37,7 @@
     def check_condition(self):
         """ checks valid page and rev """
         _ = self._
-        if not self.request.rev:
+        if not self.request.rev or Page(self.request, self.pagename).current_rev() == self.request.rev:
             # same string as in PageEditor...
             note = _('You were viewing the current revision of this page when you called the revert action. '
                      'If you want to revert to an older revision, first view that older revision and '