Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Datastore Tables Job #196

Merged
7 changes: 6 additions & 1 deletion ckanext/xloader/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,14 @@ def get_helpers(self):
def _should_remove_unsupported_resource_from_datastore(res_dict):
if not toolkit.asbool(toolkit.config.get('ckanext.xloader.clean_datastore_tables', False)):
return False
has_url_type = True
try:
has_url_type = toolkit.asbool(res_dict.get('url_type'))
except ValueError:
pass
return (not XLoaderFormats.is_it_an_xloader_format(res_dict.get('format', u''))
and (res_dict.get('url_type') == 'upload'
or res_dict.get('url_type') == '')
or not has_url_type)
JVickery-TBS marked this conversation as resolved.
Show resolved Hide resolved
and (toolkit.asbool(res_dict.get('datastore_active', False))
or toolkit.asbool(res_dict.get('extras', {}).get('datastore_active', False))))

Expand Down