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

Validation Extension Support #200

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f0a470a
feat(dev): adds validation extension support;
JVickery-TBS Nov 24, 2023
a97f4ad
feat(dev): logging;
JVickery-TBS Nov 24, 2023
028e42b
fix(dev): 2.9 support;
JVickery-TBS Nov 24, 2023
77d762e
fix(dev): better conditioning;
JVickery-TBS Nov 27, 2023
aec22b9
feat(comments): added comments;
JVickery-TBS Nov 27, 2023
cd3c7cc
Merge branch 'master' into feature/validation-support
JVickery-TBS Jan 29, 2024
7e99aa7
fix(dev): misc feedback;
JVickery-TBS Jan 29, 2024
25ea76e
fix(dev): misc fixes;
JVickery-TBS Jan 29, 2024
d2720fc
fix(syntax): flake8;
JVickery-TBS Jan 31, 2024
e888153
feat(dev): logic and schema config option;
JVickery-TBS Feb 2, 2024
5c07ba4
Merge branch 'master' into feature/validation-support
JVickery-TBS Feb 2, 2024
4612484
feat(dev): better logic and tests;
JVickery-TBS Feb 2, 2024
8ac8db5
fix(logic): fixed some logic;
JVickery-TBS Feb 2, 2024
d9bb56c
Merge branch 'master' into feature/validation-support
JVickery-TBS Feb 5, 2024
1ac8090
fix(syntax): made better;
JVickery-TBS Feb 5, 2024
1761ed5
fix(comments): fixed inline comments;
JVickery-TBS Feb 5, 2024
e182eb7
feat(dev): started doing sync mode;
JVickery-TBS Feb 6, 2024
b386e0e
feat(dev): sync mode cont.;
JVickery-TBS Feb 7, 2024
3200483
feat(dev): sync mode cont.;
JVickery-TBS Feb 7, 2024
d225801
Merge branch 'master' into feature/validation-support
JVickery-TBS May 16, 2024
4fbdb0d
feat(dev): IPipeValidation implementation;
JVickery-TBS May 16, 2024
27d98cf
fix(tests): validation req tests;
JVickery-TBS May 16, 2024
378f69f
fix(misc): comments and messages;
JVickery-TBS Jul 12, 2024
6070740
fix(logic): ignore not sysadmin;
JVickery-TBS Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ckanext/xloader/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def notify(self, entity, operation):
# extension will call resource_patch and this method should
# be called again. However, url_changed will not be in the entity
# once Validation does the patch.
if 'validation' in toolkit.config.get('ckan.plugins', []) and \
if _is_validation_plugin_loaded() and \
toolkit.asbool(toolkit.config.get('ckanext.xloader.requires_validation')):
JVickery-TBS marked this conversation as resolved.
Show resolved Hide resolved
if entity.__dict__.get('extras', {}).get('validation_status', None) != 'success':
JVickery-TBS marked this conversation as resolved.
Show resolved Hide resolved
log.debug("Skipping xloading resource %s because "
Expand All @@ -139,7 +139,7 @@ def notify(self, entity, operation):
# IResourceController

def after_resource_create(self, context, resource_dict):
if 'validation' in toolkit.config.get('ckan.plugins', []) and \
if _is_validation_plugin_loaded() and \
toolkit.asbool(toolkit.config.get('ckanext.xloader.requires_validation')) and \
resource_dict.get('validation_status', None) != 'success':
log.debug("Skipping xloading resource %s because "
Expand Down Expand Up @@ -246,3 +246,11 @@ def get_helpers(self):
"xloader_status": xloader_helpers.xloader_status,
"xloader_status_description": xloader_helpers.xloader_status_description,
}


def _is_validation_plugin_loaded():
try:
toolkit.get_action('resource_validation_show')
except KeyError:
return False
return True
JVickery-TBS marked this conversation as resolved.
Show resolved Hide resolved