Skip to content

Commit 1ac8090

Browse files
committed
fix(syntax): made better;
- Better conditional syntax.
1 parent d9bb56c commit 1ac8090

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ckanext/xloader/utils.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,11 @@ def awaiting_validation(res_dict):
7676
log.warning('ckanext.xloader.validation.requires_successful_report requires the ckanext-validation plugin to be activated.')
7777
return False
7878

79-
if p.toolkit.asbool(config.get('ckanext.xloader.validation.enforce_schema', True)):
80-
# validation.enforce_schema is turned on, explicitly check for the `validation_status`
81-
if res_dict.get('validation_status', None) != 'success':
82-
return True
83-
else:
84-
return False
79+
if (p.toolkit.asbool(config.get('ckanext.xloader.validation.enforce_schema', True))
80+
or res_dict.get('schema', None)) and res_dict.get('validation_status', None) != 'success':
8581

86-
elif res_dict.get('schema', None) and res_dict.get('validation_status', None) != 'success':
87-
# validation.enforce_schema is turned off, and there is a Validation Schema and no successful report.
82+
# either validation.enforce_schema is turned on or it is off and there is not schema to enfroce,
83+
# we then explicitly check for the `validation_status` report to be `success``
8884
return True
8985

9086
# at this point, we can assume that the Resource is not waiting for Validation.

0 commit comments

Comments
 (0)