# HG changeset patch # User gibus # Date 1358156601 -3600 # Node ID 65baad712962f3e407bed24413451688224a24a6 # Parent 00f61fe2430a057f3929e35e3d6eba855e81f3d7 Do not try to process custom_css if none has be defined diff -r 00f61fe2430a -r 65baad712962 src/cm/views/texts.py --- a/src/cm/views/texts.py Fri Jan 11 16:51:16 2013 +0100 +++ b/src/cm/views/texts.py Mon Jan 14 10:43:21 2013 +0100 @@ -256,11 +256,13 @@ template_dict['json_filter_datas'] = jsonize(filter_datas, request) from cm.models import ApplicationConfiguration custom_css_str = ApplicationConfiguration.get_key('custom_css') - custom_css = cssutils.parseString(custom_css_str) - for css_rule in custom_css: - if css_rule.type == css_rule.STYLE_RULE and css_rule.wellformed: - css_rule.selectorText = "#textcontainer %s" %css_rule.selectorText - template_dict['custom_css'] = custom_css.cssText + if custom_css_str: + custom_css = cssutils.parseString(custom_css_str) + for css_rule in custom_css: + if css_rule.type == css_rule.STYLE_RULE and css_rule.wellformed: + css_rule.selectorText = "#textcontainer %s" %css_rule.selectorText + template_dict['custom_css'] = custom_css.cssText + template_dict['custom_font'] = ApplicationConfiguration.get_key('custom_font') template_dict['custom_titles_font'] = ApplicationConfiguration.get_key('custom_titles_font') return render_to_response('site/text_view_comments.html',