[webconfig] cleanly handles ``fckeditor_installed`` when no uiprops stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 08 Apr 2013 16:43:26 +0200
branchstable
changeset 8870 c9d18b8dbfea
parent 8869 a46197b1696f
child 8871 7d1ccaac5ae3
[webconfig] cleanly handles ``fckeditor_installed`` when no uiprops The previous version of the code relied on a default value with a dummy ``FCKEDITOR_PATH`` entry. The new code check if uiprops is initialized or not.
web/webconfig.py
--- a/web/webconfig.py	Mon Apr 08 16:19:29 2013 +0200
+++ b/web/webconfig.py	Mon Apr 08 16:43:26 2013 +0200
@@ -81,7 +81,6 @@
     """
     cubicweb_appobject_path = CubicWebConfiguration.cubicweb_appobject_path | set([join('web', 'views')])
     cube_appobject_path = CubicWebConfiguration.cube_appobject_path | set(['views'])
-    uiprops = {'FCKEDITOR_PATH': ''}
 
     options = merge_options(CubicWebConfiguration.options + (
         ('repository-uri',
@@ -244,7 +243,9 @@
         self.https_datadir_url = None
 
     def fckeditor_installed(self):
-        return exists(self.uiprops['FCKEDITOR_PATH'])
+        if self.uiprops is None:
+            return False
+        return exists(self.uiprops.get('FCKEDITOR_PATH', ''))
 
     def cwproperty_definitions(self):
         for key, pdef in super(WebConfiguration, self).cwproperty_definitions():