[kupu-checkins] r35486 - kupu/trunk/kupu/plone

duncan at codespeak.net duncan at codespeak.net
Fri Dec 8 15:15:29 CET 2006


Author: duncan
Date: Fri Dec  8 15:15:28 2006
New Revision: 35486

Modified:
   kupu/trunk/kupu/plone/plonelibrarytool.py
Log:
Avoid bombing if wysiwyg_editor property is None. (Thanks to Vitalie Cherpec)

Modified: kupu/trunk/kupu/plone/plonelibrarytool.py
==============================================================================
--- kupu/trunk/kupu/plone/plonelibrarytool.py	(original)
+++ kupu/trunk/kupu/plone/plonelibrarytool.py	Fri Dec  8 15:15:28 2006
@@ -270,8 +270,10 @@
             return False
 
         user = pm.getAuthenticatedMember()
-        if user.getProperty('wysiwyg_editor').lower() != 'kupu':
-            return False
+        if not pm.isAnonymousUser():
+            editor = user.getProperty('wysiwyg_editor')
+            if editor and editor.lower() != 'kupu':
+                return False
 
         # Then check whether the current content allows html
         if context is not None and fieldName and hasattr(context, 'getWrappedField'):
@@ -325,7 +327,8 @@
         """Find the appropriate template to use for the kupu widget"""
         pm = getToolByName(self, 'portal_membership')
         user = pm.getAuthenticatedMember()
-        editor = user.getProperty('wysiwyg_editor', '').lower()
+        editor = user.getProperty('wysiwyg_editor', '')
+        if editor: editor = editor.lower()
         if editor=='fck editor':
             editor = 'editor_fck'
 


More information about the kupu-checkins mailing list