From 4318bbe9086469778b86a78be6d4f58c93a34f20 Mon Sep 17 00:00:00 2001 From: amercader Date: Fri, 27 Feb 2015 10:38:12 +0000 Subject: [PATCH] [#2320] Don't assume resource format is there --- ckanext/textpreview/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/textpreview/plugin.py b/ckanext/textpreview/plugin.py index 407fa52d7c9..32209d2cb98 100644 --- a/ckanext/textpreview/plugin.py +++ b/ckanext/textpreview/plugin.py @@ -63,7 +63,7 @@ def configure(self, config): def can_preview(self, data_dict): resource = data_dict['resource'] - format_lower = resource['format'].lower() + format_lower = resource.get('format', '').lower() quality = QUALITY.get(format_lower, 1)