[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-checkins
Subject:    [kupu-checkins] r35486 - kupu/trunk/kupu/plone
From:       duncan () codespeak ! net
Date:       2006-12-08 14:15:29
Message-ID: 20061208141529.C76A710088 () code0 ! codespeak ! net
[Download RAW message or body]

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'
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic