1.1 --- a/actions/ApproveChanges.py Tue Sep 03 00:33:30 2013 +0200
1.2 +++ b/actions/ApproveChanges.py Tue Nov 05 20:33:53 2013 +0100
1.3 @@ -7,7 +7,7 @@
1.4 in a subpage, this action just moves the queued page content into the
1.5 existing page when approving the changes.
1.6
1.7 - @copyright: 2011 Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2011, 2013 Paul Boddie <paul@boddie.org.uk>
1.9 @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 """
1.11
1.12 @@ -25,6 +25,8 @@
1.13
1.14 "An action which approves a queued page version."
1.15
1.16 + queued_content_directives = ["acl", "parent-revision", "unapproved-user", "unapproved-user-queue"]
1.17 +
1.18 def __init__(self, pagename, request):
1.19 ActionBase.__init__(self, pagename, request)
1.20 _ = self._
1.21 @@ -61,11 +63,11 @@
1.22 # Get information about the queued changes.
1.23
1.24 body = self.get_body(rev)
1.25 - _body, directives = remove_directives(body, ["acl", "parent-revision", "unapproved-user"])
1.26 + _body, directives = remove_directives(body, self.queued_content_directives)
1.27
1.28 # Get the target page's parent revision for the queued changes.
1.29
1.30 - target_page_name = get_target_page_name(self.pagename)
1.31 + target_page_name = get_target_page_name(self.page)
1.32 target_page = PageEditor(request, target_page_name)
1.33
1.34 current_rev = target_page.current_rev()
1.35 @@ -146,11 +148,11 @@
1.36
1.37 # Remove any introduced directives.
1.38
1.39 - body, directives = remove_directives(body, ["acl", "parent-revision", "unapproved-user"])
1.40 + body, directives = remove_directives(body, self.queued_content_directives)
1.41
1.42 # Get the target page's parent revision for the queued changes.
1.43
1.44 - target_page_name = get_target_page_name(self.pagename)
1.45 + target_page_name = get_target_page_name(self.page)
1.46 target_page = PageEditor(request, target_page_name)
1.47
1.48 current_rev = target_page.current_rev()
1.49 @@ -200,7 +202,9 @@
1.50
1.51 # Prepare a comment.
1.52
1.53 - comment = _("Changes to page approved from queue revision %d.") % rev
1.54 + comment = username and \
1.55 + _("Changes to page by %s approved from queue revision %d.") % (username, rev) or \
1.56 + _("Changes to page approved from queue revision %d.") % rev
1.57
1.58 # Save the target page, but only if there is no conflict.
1.59