UPDATE: fix bug in field

This commit is contained in:
daovietanh99 2024-02-21 14:55:31 +07:00
parent 7f3e198911
commit caa6bcda84

View File

@ -577,9 +577,7 @@ class RequestViewSet(viewsets.ViewSet):
data = []
files = []
file_query = Q(request=request_id)
subscription_request_files = SubscriptionRequestFile.objects.filter(file_query)
subscription_request_files = SubscriptionRequestFile.objects.filter(request=subscription_request.id)
for subscription_request_file in subscription_request_files:
files.append({
@ -616,7 +614,6 @@ class RequestViewSet(viewsets.ViewSet):
'Client Request Time (ms)': subscription_request.client_request_time,
'Server Processing Time (ms)': subscription_request.preprocessing_time + subscription_request.ai_inference_time,
'Is Reviewed': subscription_request.is_reviewed,
'Subscription': subscription_request.subscription,
'Feedback Accuracy': subscription_request.feedback_accuracy,
'Reviewed Accuracy': subscription_request.reviewed_accuracy,
'Created At': subscription_request.created_at.isoformat(),
@ -641,9 +638,7 @@ class RequestViewSet(viewsets.ViewSet):
subscription_request = subscription_request.first()
file_query = Q(request=request_id)
subscription_request_files = SubscriptionRequestFile.objects.filter(file_query)
subscription_request_files = SubscriptionRequestFile.objects.filter(request=subscription_request.id)
reviewed_result = json.loads(data["reviewed_result"])
@ -682,9 +677,7 @@ class RequestImageViewSet(viewsets.ViewSet):
subscription_request = subscription_request.first()
file_query = Q(request=request_id)
subscription_request_files = SubscriptionRequestFile.objects.filter(file_query)
subscription_request_files = SubscriptionRequestFile.objects.filter(request=subscription_request.id)
for subscription_request_file in subscription_request_files:
if image_name == subscription_request_file.file_name: