[#29] Fix missing variable
This commit is contained in:
parent
f4ea4da3e0
commit
f0aa5076a0
|
@ -21,7 +21,6 @@ class WMSPreview(p.SingletonPlugin):
|
||||||
|
|
||||||
self.proxy_enabled = p.toolkit.asbool(config.get('ckan.resource_proxy_enabled', 'False'))
|
self.proxy_enabled = p.toolkit.asbool(config.get('ckan.resource_proxy_enabled', 'False'))
|
||||||
|
|
||||||
|
|
||||||
def setup_template_variables(self, context, data_dict):
|
def setup_template_variables(self, context, data_dict):
|
||||||
import ckanext.resourceproxy.plugin as proxy
|
import ckanext.resourceproxy.plugin as proxy
|
||||||
if self.proxy_enabled and not data_dict['resource']['on_same_domain']:
|
if self.proxy_enabled and not data_dict['resource']['on_same_domain']:
|
||||||
|
@ -30,6 +29,8 @@ class WMSPreview(p.SingletonPlugin):
|
||||||
p.toolkit.c.resource['proxy_url'] = data_dict['resource']['url']
|
p.toolkit.c.resource['proxy_url'] = data_dict['resource']['url']
|
||||||
|
|
||||||
def can_preview(self, data_dict):
|
def can_preview(self, data_dict):
|
||||||
|
format_lower = data_dict['resource']['format'].lower()
|
||||||
|
|
||||||
correct_format = format_lower in self.WMS
|
correct_format = format_lower in self.WMS
|
||||||
can_preview_from_domain = self.proxy_enabled or data_dict['resource']['on_same_domain']
|
can_preview_from_domain = self.proxy_enabled or data_dict['resource']['on_same_domain']
|
||||||
quality = 2
|
quality = 2
|
||||||
|
|
Loading…
Reference in New Issue