fix minor bug
This commit is contained in:
parent
8030ba0e3d
commit
7cb21817ed
@ -536,6 +536,10 @@ def first_of_list(the_list):
|
||||
return the_list[0]
|
||||
|
||||
def _feedback_invoice_no_exist(feedback_result):
|
||||
if feedback_result is None:
|
||||
return True
|
||||
if not isinstance(feedback_result, dict):
|
||||
return True
|
||||
invoice_no = feedback_result.get("invoice_no", None)
|
||||
if invoice_no in ["", [], None]:
|
||||
return False
|
||||
@ -700,8 +704,7 @@ def calculate_accuracy(key_name: str, inference: Dict[str, Union[str, List]], ta
|
||||
_inference = inference[key_name]
|
||||
_target = target[key_name]
|
||||
_will_acc_be_ignored = _acc_will_be_ignored(key_name, _target, type)
|
||||
_inference = _accuracy_calculate_formatter(_inference)
|
||||
_target = _accuracy_calculate_formatter(_target)
|
||||
_inference, _target = _accuracy_calculate_formatter(_inference, _target)
|
||||
|
||||
for i, v in enumerate(_inference):
|
||||
# TODO: target[i] is None, ""
|
||||
@ -860,13 +863,12 @@ def calculate_a_request(report, request):
|
||||
image.reviewed_result["purchase_date"] = att["normalized_data"]["reviewed"]["purchase_date"][rv_max_indexes["purchase_date"]][1]
|
||||
request_att["is_reviewed"].append(att["is_reviewed"])
|
||||
|
||||
if att["is_reviewed"] == -1: # -1 means "not required"
|
||||
if att["is_reviewed"] !=1:
|
||||
att["acc"]["reviewed"] = {}
|
||||
reviewed_result = {}
|
||||
reason = None
|
||||
counter_measure = None
|
||||
else:
|
||||
if att["is_reviewed"] == 1:
|
||||
reviewed_result = image.reviewed_result
|
||||
reason = image.reason
|
||||
counter_measure = image.counter_measures
|
||||
|
Loading…
Reference in New Issue
Block a user