Skip to content

Commit

Permalink
[#2320] Don't assume resource format is there
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Feb 27, 2015
1 parent 87870be commit 5f1d251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/jsonpreview/plugin.py
Expand Up @@ -41,7 +41,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()
if format_lower in self.JSONP_FORMATS:
return True
elif format_lower in self.JSON_FORMATS and (self.proxy_is_enabled or resource['on_same_domain']):
Expand Down

0 comments on commit 5f1d251

Please sign in to comment.