1.1 --- a/actions/ApproveChanges.py Mon Oct 10 22:15:09 2011 +0200
1.2 +++ b/actions/ApproveChanges.py Mon Oct 10 22:28:58 2011 +0200
1.3 @@ -3,8 +3,8 @@
1.4 MoinMoin - ApproveChanges
1.5
1.6 Permit the approval of an edited page queued by the page editor when an
1.7 - unprivileged user attempted to save a page. Since queued pages are placed in
1.8 - a subpage area, this action just moves the queued page content into the
1.9 + unprivileged user attempted to save a page. Since queued changes are placed
1.10 + in a subpage, this action just moves the queued page content into the
1.11 existing page when approving the changes.
1.12
1.13 @copyright: 2011 Paul Boddie <paul@boddie.org.uk>
1.14 @@ -73,7 +73,7 @@
1.15
1.16 # Make sure that only suitably privileged users can perform this action.
1.17
1.18 - queued_changes_area = get_queued_changes_area(request)
1.19 + queued_changes_page = get_queued_changes_page(request)
1.20 reviewers_group = getattr(request.cfg, "reviewers_group", "PageReviewersGroup")
1.21
1.22 if not request.user.valid or (
1.23 @@ -85,7 +85,7 @@
1.24 # Edit the target page, using this page's content.
1.25 # The current page must be a queued page version.
1.26
1.27 - if not is_queued_page(self.pagename, queued_changes_area):
1.28 + if not is_queued_changes_page(request, self.pagename):
1.29 return 0, _("This page is not queued for approval.")
1.30
1.31 target_page_name = get_target_page_name(self.pagename)
1.32 @@ -99,19 +99,13 @@
1.33 pass
1.34
1.35 # Delete the current page.
1.36 + # NOTE: The page could be deleted completely or certain revisions
1.37 + # NOTE: purged.
1.38 + # NOTE: (to-do/proper-queued-page-deletion.txt)
1.39
1.40 current_page = PageEditor(request, self.pagename)
1.41 current_page.deletePage(_("Changes to page approved."))
1.42
1.43 - # Delete the rest of the queue if requested.
1.44 -
1.45 - form = get_form(request)
1.46 -
1.47 - if form.get("purge"):
1.48 - for name in get_queue_pages(request, target_page_name, queued_changes_area):
1.49 - queue_page = PageEditor(request, name)
1.50 - queue_page.deletePage(_("Changes to page rejected."))
1.51 -
1.52 # Redirect to the target page.
1.53
1.54 request.http_redirect(target_page.url(request))