File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,12 @@ def get_recommended_products(self, obj):
140140        recommended_products  =  [product .product_id  for  product  in 
141141                                recommender .suggest_products_for ([obj ], max_results = 5 )]
142142        suggested_products  =  (
143-                                  Product .objects .filter (
144-                                      Q (category = obj .category ) |  Q (
145-                                          tags__in = obj .tags .all () |  Q (product_id__in = recommended_products )
146-                                      )).exclude (product_id = obj .product_id ).distinct ())[:10 ]
143+             Product .objects .filter (
144+                 Q (category = obj .category ) | 
145+                 Q (tags__in = obj .tags .all ()) | 
146+                 Q (product_id__in = recommended_products )
147+             ).exclude (product_id = obj .product_id ).distinct ()[:10 ]
148+         )
147149        return  ProductSerializer (suggested_products , many = True , context = self .context ).data 
148150
149151    class  Meta (ProductSerializer .Meta ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments