comparison MoinMoin/action/revert.py @ 3367:48acb9e0a097

action.revert: fixed doc string
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Mar 2008 21:20:41 +0100
parents 80ecec6e008b
children c20aa5b0158e
comparison
equal deleted inserted replaced
3366:80ecec6e008b 3367:48acb9e0a097
32 may = self.request.user.may 32 may = self.request.user.may
33 allowed = may.write(self.pagename) and may.delete(self.pagename) 33 allowed = may.write(self.pagename) and may.delete(self.pagename)
34 return allowed, _('You are not allowed to revert this page!') 34 return allowed, _('You are not allowed to revert this page!')
35 35
36 def check_condition(self): 36 def check_condition(self):
37 """ checks page and revision """
37 _ = self._ 38 _ = self._
38 if not self.request.rev: 39 if not self.request.rev:
39 # same string as in PageEditor... 40 # same string as in PageEditor...
40 note = _('You were viewing the current revision of this page when you called the revert action. ' 41 note = _('You were viewing the current revision of this page when you called the revert action. '
41 'If you want to revert to an older revision, first view that older revision and ' 42 'If you want to revert to an older revision, first view that older revision and '
46 return _('This page is already deleted or was never created!') 47 return _('This page is already deleted or was never created!')
47 else: 48 else:
48 return None 49 return None
49 50
50 def do_action(self): 51 def do_action(self):
51 """ Delete pagename """ 52 """ Revert pagename """
52 _ = self._ 53 _ = self._
53 54
54 if self.request.request_method != 'POST': 55 if self.request.request_method != 'POST':
55 return False, u'' 56 return False, u''
56 57
77 msg = unicode(error) 78 msg = unicode(error)
78 79
79 return True, msg 80 return True, msg
80 81
81 def get_form_html(self, buttons_html): 82 def get_form_html(self, buttons_html):
83 """ creates the form """
82 _ = self._ 84 _ = self._
83 85
84 d = { 86 d = {
85 'pagename': self.pagename, 87 'pagename': self.pagename,
86 'comment_label': _("Optional reason for reverting this page"), 88 'comment_label': _("Optional reason for reverting this page"),