Skip to content

Commit

Permalink
Merge pull request #342 from IATI/fix_falsey_tests
Browse files Browse the repository at this point in the history
fix: falsey tests for var which can be None
  • Loading branch information
simon-20 authored Aug 1, 2024
2 parents 87c9ef4 + 97f68d8 commit fe72f57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/library/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def process_hash_list(document_datasets):
file_schema_valid = file_data[6]
publisher_black_flag = file_data[7] is not None

if not file_schema_valid and downloaded > (
if file_schema_valid is False and downloaded > (
now - timedelta(hours=config["VALIDATION"]["SAFETY_CHECK_PERIOD"])
):
logger.info(
Expand All @@ -43,7 +43,7 @@ def process_hash_list(document_datasets):
)
continue

if not file_schema_valid and publisher_black_flag:
if file_schema_valid is False and publisher_black_flag:
logger.info(
"Skipping Schema Invalid file for Full Validation since publisher: "
f"{publisher} is black flagged for hash: {file_hash} and id: {file_id}"
Expand Down Expand Up @@ -115,7 +115,7 @@ def process_hash_list(document_datasets):
)
continue

if not file_schema_valid and downloaded > (
if file_schema_valid is False and downloaded > (
now - timedelta(hours=config["VALIDATION"]["SAFETY_CHECK_PERIOD"])
):
logger.info(
Expand All @@ -125,7 +125,7 @@ def process_hash_list(document_datasets):
)
continue

if not file_schema_valid and publisher_black_flag:
if file_schema_valid is False and publisher_black_flag:
logger.info(
f"Skipping Schema Invalid file for Full Validation since publisher: {publisher} "
f"is flagged for hash: {file_hash} and id: {file_id}"
Expand Down

0 comments on commit fe72f57

Please sign in to comment.