# HG changeset patch # User Paul Boddie # Date 1318545347 -7200 # Node ID ec7051aece28f18fd74bb574ba5ae1b2c5cb82d8 # Parent 802cd643f430d5e16b5315e5de16c267c14275ba Replaced page saving and redirection to the edit action for the new page with an invocation of the page editor, thus avoiding saving a page for a new event straight away. diff -r 802cd643f430 -r ec7051aece28 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Mon Oct 10 01:31:24 2011 +0200 +++ b/EventAggregatorSupport.py Fri Oct 14 00:35:47 2011 +0200 @@ -2745,6 +2745,8 @@ new_event = Event(new_event_page, event_details) new_event_page.setEvents([new_event]) new_event_page.setCategoryMembership(category_pagenames) - new_event_page.saveChanges() + new_event_page.flushEventDetails() + + return new_event_page.getBody() # vim: tabstop=4 expandtab shiftwidth=4 diff -r 802cd643f430 -r ec7051aece28 README.txt --- a/README.txt Mon Oct 10 01:31:24 2011 +0200 +++ b/README.txt Fri Oct 14 00:35:47 2011 +0200 @@ -298,6 +298,15 @@ time zone information for the correct interpretation of time information in those summaries. Thus, it is highly recommended that pytz be installed. +New in EventAggregator 0.8.1 (Changes since EventAggregator 0.8) +---------------------------------------------------------------- + + * Changed the EventAggregatorNewEvent action to not save new event pages + directly, instead invoking the textual page editor for the page so that + the page text can be changed and the page saved without a redundant + initial version being created. Cancelling the editing operation will also + avoid the creation of unwanted event pages. + New in EventAggregator 0.8 (Changes since EventAggregator 0.7.1) ---------------------------------------------------------------- diff -r 802cd643f430 -r ec7051aece28 actions/EventAggregatorNewEvent.py --- a/actions/EventAggregatorNewEvent.py Mon Oct 10 01:31:24 2011 +0200 +++ b/actions/EventAggregatorNewEvent.py Fri Oct 14 00:35:47 2011 +0200 @@ -674,14 +674,23 @@ if new_page.exists(): return 0, _("The specified page already exists. Please choose another name.") - # Complete the new page. + # Complete the new page and return its body. - fillEventPageFromTemplate(template_page, new_page, event_details, category_pagenames) + body = fillEventPageFromTemplate(template_page, new_page, event_details, category_pagenames) - # Redirect and return success. + # Open the page editor on the new page. + # NOTE: Replacing the revision in the request to prevent Moin from + # NOTE: attempting to use the queued changes page's revision. + # NOTE: Replacing the action and page in the request to avoid issues + # NOTE: with editing tickets. - query = {'action' : 'edit'} - request.http_redirect(new_page.url(request, query)) + request.rev = 0 + request.action = "edit" + request.page = new_page + new_page.sendEditor(preview=body, staytop=True) + + # Return success. + return 1, None # Action function.