FIX: check invalid

This commit is contained in:
daovietanh99 2024-02-22 10:42:04 +07:00
parent f88afa5444
commit d156c1d937

View File

@ -675,7 +675,10 @@ class AccuracyViewSet(viewsets.ViewSet):
subscription_request_files = SubscriptionRequestFile.objects.filter(request=subscription_request.id)
reviewed_result = json.loads(data["reviewed_result"])
if not data["reviewed_result"]:
raise InvalidException(excArgs=f'reviewed_result')
reviewed_result = data["reviewed_result"]
for field in ['retailername', 'sold_to_party', 'purchase_date', 'imei_number']:
if not field in reviewed_result.keys():
raise RequiredFieldException(excArgs=f'reviewed_result.{field}')