Skip to content.

Etria Lists

 

[quills-dev] [Collective-checkins] r32145 - Quills/trunk

quills-dev at lists.etria.com quills-dev at lists.etria.com
Mon Oct 23 00:55:27 UTC 2006


Author: tomster
Date: Mon Oct 23 00:55:26 2006
New Revision: 32145

Modified:
   Quills/trunk/MetaWeblogAPI.py
Log:
bugfixes:

 * fixed case-typo in `_getEffectiveDate`
 * removed try-except statements that I had originally inserted in good faith, but that really just camouflage the underlying errors, i.e. it's better to throw a DateTime syntax exception instead of just silently returning `False` (which will then be interpreted as `0` by some clients as the id of the created post (which has never been created due to that parse-error)... etc. pp.)

Modified: Quills/trunk/MetaWeblogAPI.py
==============================================================================
--- Quills/trunk/MetaWeblogAPI.py	(original)
+++ Quills/trunk/MetaWeblogAPI.py	Mon Oct 23 00:55:26 2006
@@ -74,7 +74,7 @@
                         )
         if ed is None:
             ed = struct.get('dateCreated',
-                            struct.get('datecreated',
+                            struct.get('dateCreated',
                                        DateTime.DateTime())
                             )
         return ed
@@ -108,19 +108,11 @@
         # transition which attempts to move the entry from the drafts folder into the archive
         # (which fails with a CopyError) but rather the 'publish_in_place'.
         if publish:
-            try:
-                dest = archive.createPath(effective_date)
-            except Exception, e:
-                self.plone_log("Cannot create destination: %s" % e)
-                return False
+            dest = archive.createPath(effective_date)
         else:   
             dest = drafts
         
-        try:
-            dest.invokeFactory(id=id, type_name='WeblogEntry', title=title)
-        except Exception, e:
-            self.plone_log("Cannot create WeblogEntry: %s" % e)
-            return False
+        dest.invokeFactory(id=id, type_name='WeblogEntry', title=title)
         
         entry = getattr(dest, id)
         entry.setText(body, mimetype='text/html')
@@ -138,7 +130,6 @@
             entry.setEffectiveDate(effective_date)
             wf_tool.doActionFor(entry, 'publish_in_place', 'quills_workflow')
         entry.reindexObject()
-        #self.plone_log("returning " + entry_uid)
         return entry_uid
 
     security.declareProtected(CMFCorePermissions.ModifyPortalContent, 'editPost')

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Collective-checkins mailing list
Collective-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/collective-checkins



More information about the quills-dev mailing list