Skip to content

Commit

Permalink
fix: exclude nutrition id containing nutrition-score (#8035)
Browse files Browse the repository at this point in the history
exclude nutrition id containing nutrition-score
  • Loading branch information
benbenben2 authored Jan 26, 2023
1 parent 43c74d6 commit 3641834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ProductOpener/DataQualityFood.pm
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ sub check_nutrition_data ($product_ref) {
$nid_non_zero++;
}
}
# negative value in nutrition table
if ($product_ref->{nutriments}{$nid} < 0) {
# negative value in nutrition table, exclude key containing "nutrition-score" as they can be negative
if (($product_ref->{nutriments}{$nid} < 0) and (index($nid, "nutrition-score") == -1)) {
push @{$product_ref->{data_quality_errors_tags}}, "en:nutrition-value-negative-$nid2";
}
}
Expand Down

0 comments on commit 3641834

Please sign in to comment.