comparison MoinMoin/action/revert.py @ 3374:043689a3b04c

action.revert: fixed doc string
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Mar 2008 22:03:19 +0100
parents c20aa5b0158e
children 4082eab1fe16 126559845d4b
comparison
equal deleted inserted replaced
3373:c20aa5b0158e 3374:043689a3b04c
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 valid page and rev """
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 form = self.form 53 form = self.form
53 comment = form.get('comment', [u''])[0] 54 comment = form.get('comment', [u''])[0]
54 comment = wikiutil.clean_input(comment) 55 comment = wikiutil.clean_input(comment)
55 56
56 if self.request.request_method != 'POST': 57 if self.request.request_method != 'POST':
69 msg = unicode(error) 70 msg = unicode(error)
70 71
71 return True, msg 72 return True, msg
72 73
73 def get_form_html(self, buttons_html): 74 def get_form_html(self, buttons_html):
75 """ creates the form """
74 _ = self._ 76 _ = self._
75 77
76 d = { 78 d = {
77 'pagename': self.pagename, 79 'pagename': self.pagename,
78 'comment_label': _("Optional reason for reverting this page"), 80 'comment_label': _("Optional reason for reverting this page"),