Skip to content

Commit

Permalink
worked on the one_time_presence_check function
Browse files Browse the repository at this point in the history
  • Loading branch information
binni979 committed May 9, 2024
1 parent 42d575b commit f2287ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
20 changes: 2 additions & 18 deletions pyQuARC/code/custom_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def one_item_presence_check(*field_values):
value = None

for field_value in field_values:
if field_value:
if field_value is not None:
value = field_value
validity = True
break
Expand All @@ -119,22 +119,6 @@ def dif_standard_product_check(*field_values):
break
return {"valid": validity, "value": value}

@staticmethod
def standard_product_check(*field_values):
"""
This function iterates over a tuple of field values. It checks each field value to determine
if it contains the field_value True or False.
"""
validity = False
value = None

for field_value in field_values:
if field_value in [True, False]:
value = field_value
validity = True
break
return {"valid": validity, "value": value}

@staticmethod
def license_url_description_check(description_field, url_field, license_text):
"""
Expand All @@ -146,7 +130,7 @@ def license_url_description_check(description_field, url_field, license_text):
description_field (string): string describing the URL
"""
validity = True
value = description_field
value = description_field

if not license_text and not url_field:
validity = False
Expand Down
5 changes: 0 additions & 5 deletions pyQuARC/schemas/checks.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@
"check_function": "dif_standard_product_check",
"available": true
},
"standard_product_check": {
"data_type": "custom",
"check_function": "standard_product_check",
"available": true
},
"doi_link_update": {
"data_type": "url",
"check_function": "doi_link_update",
Expand Down
2 changes: 1 addition & 1 deletion pyQuARC/schemas/rule_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,7 @@
]
},
"severity": "warning",
"check_id": "standard_product_check"
"check_id": "one_item_presence_check"
},
"dif_standard_product_check": {
"rule_name": "Standard Product Check",
Expand Down

0 comments on commit f2287ea

Please sign in to comment.