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