From c9c3f92150e7a23e2b9694ba9b7b8bde8c2a9a3a Mon Sep 17 00:00:00 2001 From: TannedCung Date: Fri, 14 Jun 2024 18:27:49 +0700 Subject: [PATCH] middfle commit --- cope2n-api/fwd_api/api/accuracy_view.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cope2n-api/fwd_api/api/accuracy_view.py b/cope2n-api/fwd_api/api/accuracy_view.py index bec5437..6809aaf 100755 --- a/cope2n-api/fwd_api/api/accuracy_view.py +++ b/cope2n-api/fwd_api/api/accuracy_view.py @@ -982,11 +982,13 @@ class AccuracyViewSet(viewsets.ViewSet): "purchase_date": None, "imei_number": [] } - for k, v in file_result.items(): + for k, v in file_result.items(): if k in sample_result.keys(): + if k == "purchase_date" and v is not None: + v = v.split("") if not isinstance(sample_result[k], list): sample_result[k] = v - elif v: + else: sample_result[k].append(v) if subscription_request_file.reviewed_result is not None: @@ -994,10 +996,8 @@ class AccuracyViewSet(viewsets.ViewSet): else: subscription_request_file.reviewed_result = sample_result - if reason: - subscription_request_file.reason = reason - if solution: - subscription_request_file.counter_measures = solution + subscription_request_file.reason = reason + subscription_request_file.counter_measures = solution subscription_request_file.is_reviewed = True subscription_request_file.save() is_available = True