Skip to content

Commit 8ac8db5

Browse files
committed
fix(logic): fixed some logic;
- Fixed a logic case.
1 parent 4612484 commit 8ac8db5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ckanext/xloader/utils.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ 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-
and res_dict.get('validation_status', None) != 'success':
81-
# validation.enforce_schema is turned on, and there is no successful report.
82-
return True
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
8385

8486
elif res_dict.get('schema', None) and res_dict.get('validation_status', None) != 'success':
8587
# validation.enforce_schema is turned off, and there is a Validation Schema and no successful report.

0 commit comments

Comments
 (0)