[ckan-changes] commit/ckanext-wordpresser: amercader: Check if errors really exist

Bitbucket commits-noreply at bitbucket.org
Thu Sep 1 14:31:36 UTC 2011


1 new changeset in ckanext-wordpresser:

http://bitbucket.org/okfn/ckanext-wordpresser/changeset/c4c55012c202/
changeset:   c4c55012c202
user:        amercader
date:        2011-09-01 16:31:20
summary:     Check if errors really exist
affected #:  1 file (50 bytes)

--- a/ckanext/wordpresser/middleware.py	Tue Jul 05 13:22:46 2011 +0100
+++ b/ckanext/wordpresser/middleware.py	Thu Sep 01 15:31:20 2011 +0100
@@ -131,9 +131,10 @@
                 # short-circuited above
                 wp_error = wp_etree.xpath('//body[@id="error-page"]')
                 # set Wordpress' error text to be wrapped in our content div
-                proxy_content = wp_error[0]
-                proxy_content.tag = "div"
-                proxy_content.attrib['id'] = "content"
+                if len(wp_error) > 0:
+                    proxy_content = wp_error[0]
+                    proxy_content.tag = "div"
+                    proxy_content.attrib['id'] = "content"
             else:
                 try:
                     proxy_content = wp_etree.xpath(

Repository URL: https://bitbucket.org/okfn/ckanext-wordpresser/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list