Parcourir la source

v2 api created

Harshit Pathak il y a 3 mois
Parent
commit
08c02a53d3
2 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. BIN
      core/__pycache__/views.cpython-313.pyc
  2. 9 0
      core/views.py

BIN
core/__pycache__/views.cpython-313.pyc


+ 9 - 0
core/views.py

@@ -439,6 +439,7 @@ class BatchScoreView(View):
                     categorized = categorize_issues_and_suggestions(all_issues, all_suggestions)
                     
                     score_result['breakdown']['image_score'] =  image_score_result.get('image_score')
+                    score_result['breakdown']['attributes'] =  score_result['breakdown']['mandatory_fields']
                     
                     results.append({
                         'sku': sku,
@@ -462,6 +463,9 @@ class BatchScoreView(View):
                         'suggestions': all_suggestions
                     })
 
+
+
+
                 except Exception as e:
                     logger.error(f"[BATCH][GET] Error scoring {sku}: {str(e)}", exc_info=True)
                     errors.append({'sku': sku, 'error': str(e)})
@@ -704,6 +708,8 @@ class BatchScoreViewV2(View):
 
             total_time = round(time.time() - start, 2)
 
+            score_result['breakdown']['attributes'] =  score_result['breakdown']['mandatory_fields']
+
             return {
                 'sku': sku,
                 'title': product_data.get('title'),
@@ -725,6 +731,9 @@ class BatchScoreViewV2(View):
                 'processing_time': total_time
             }
 
+
+
+
         except Exception as e:
             logger.error(f"[BATCH][{sku}] Error: {e}", exc_info=True)
             return {'sku': sku, 'error': str(e)}