1.1 --- a/actions/EventAggregatorNewEvent.py Mon Jan 18 01:00:35 2010 +0100
1.2 +++ b/actions/EventAggregatorNewEvent.py Sun Jan 24 02:55:53 2010 +0100
1.3 @@ -2,7 +2,7 @@
1.4 """
1.5 MoinMoin - EventAggregatorNewEvent Action
1.6
1.7 - @copyright: 2008, 2009 by Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2008, 2009, 2010 by Paul Boddie <paul@boddie.org.uk>
1.9 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
1.10 2003-2008 MoinMoin:ThomasWaldmann,
1.11 2004-2006 MoinMoin:AlexanderSchremmer,
1.12 @@ -229,7 +229,7 @@
1.13 if not page.exists():
1.14 return 0, _("Event template not available.")
1.15
1.16 - body = page.get_raw_body()
1.17 + event_page = EventAggregatorSupport.EventPage(page)
1.18
1.19 # Use any parent page information.
1.20
1.21 @@ -245,15 +245,18 @@
1.22 if new_page.exists():
1.23 return 0, _("The specified page already exists. Please choose another name.")
1.24
1.25 - if EventAggregatorSupport.getFormat(page) == "wiki":
1.26 + new_event_page = EventAggregatorSupport.EventPage(new_page)
1.27 + new_event_page.copyPage(event_page)
1.28 +
1.29 + if new_event_page.getFormat() == "wiki":
1.30 event_details = {
1.31 "start" : start_date, "end" : end_date,
1.32 "title" : title, "summary" : title,
1.33 "description" : description
1.34 }
1.35 - body = EventAggregatorSupport.setEventDetails(body, event_details)
1.36 - body = EventAggregatorSupport.setCategoryMembership(body, category_pagenames)
1.37 - new_page.saveText(body, 0)
1.38 + new_event_page.setEventDetails(event_details)
1.39 + new_event_page.setCategoryMembership(category_pagenames)
1.40 + new_event_page.saveChanges()
1.41
1.42 # Redirect and return success.
1.43