1.1 --- a/events/queue_for_review.py Mon Oct 10 22:15:09 2011 +0200
1.2 +++ b/events/queue_for_review.py Mon Oct 10 22:28:58 2011 +0200
1.3 @@ -18,14 +18,18 @@
1.4 _ = request.getText
1.5
1.6 approved_editors_group = get_approved_editors_group(request)
1.7 - queued_changes_area = get_queued_changes_area(request)
1.8 + queued_changes_page = get_queued_changes_page(request)
1.9
1.10 pagename = event.page_editor.page_name
1.11
1.12 # Saving into queues has to be permitted or the mechanism will keep trying
1.13 # to save into a queue of the specified page.
1.14
1.15 - if is_queued_page(pagename, queued_changes_area):
1.16 + if is_queued_changes_page(request, pagename):
1.17 +
1.18 + # NOTE: Add ACL to prevent normal users from seeing the page anywhere.
1.19 + # NOTE: (to-do/hide-queued-pages.txt)
1.20 +
1.21 return None
1.22
1.23 # For normal pages, the user has to be approved. Otherwise, the page will be
1.24 @@ -35,21 +39,11 @@
1.25 not request.dicts.has_member(approved_editors_group, request.user.name) and \
1.26 not request.user.isSuperUser()):
1.27
1.28 - # Get a queue number by listing the subpages of the queue area and
1.29 - # finding the highest queue number, then adding one to it.
1.30 -
1.31 - queue_number = -1
1.32 + # Save the page in the queue.
1.33 + # NOTE: Record the parent revision.
1.34 + # NOTE: (to-do/record-parent-for-proper-merges.txt)
1.35
1.36 - for name in get_queue_pages(request, pagename, queued_changes_area):
1.37 - number = name.split("/")[-1]
1.38 - if number.isdigit():
1.39 - queue_number = max(queue_number, int(number))
1.40 -
1.41 - queue_number += 1
1.42 -
1.43 - # Save the page in the queue.
1.44 -
1.45 - new_page = PageEditor(request, "%s/%s/%s" % (pagename, queued_changes_area, queue_number))
1.46 + new_page = PageEditor(request, "%s/%s" % (pagename, queued_changes_page))
1.47
1.48 try:
1.49 new_page.saveText(event.new_text, 0)