comparison MoinMoin/action/revert.py @ 3366:80ecec6e008b

action.revert: keep revert action in log
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Mar 2008 21:14:58 +0100
parents bb04265ce89a
children 48acb9e0a097
comparison
equal deleted inserted replaced
3365:e64bb042f178 3366:80ecec6e008b
47 else: 47 else:
48 return None 48 return None
49 49
50 def do_action(self): 50 def do_action(self):
51 """ Delete pagename """ 51 """ Delete pagename """
52 form = self.form 52 _ = self._
53 comment = form.get('comment', [u''])[0]
54 comment = wikiutil.clean_input(comment)
55 53
56 if self.request.request_method != 'POST': 54 if self.request.request_method != 'POST':
57 return False, u'' 55 return False, u''
58 56
57 form = self.form
59 rev = self.request.rev 58 rev = self.request.rev
59 comment = form.get('comment', [u''])[0]
60 system_comment = _(u"Revert to revision %(rev)d.") % {'rev': int(rev)}
61 if not comment:
62 comment = system_comment
63 else:
64 comment = "%(comment)s (%(system_comment)s)" % {"comment": comment,
65 "system_comment": system_comment}
66
67 comment = wikiutil.clean_input(comment)
60 pg = PageEditor(self.request, self.pagename) 68 pg = PageEditor(self.request, self.pagename)
61 69
62 try: 70 try:
63 msg = pg.revertPage(rev, comment) 71 msg = pg.revertPage(rev, comment)
64 # make it show the current version... 72 # make it show the current version...