Skip to content

Commit e954002

Browse files
committed
Allow sending several products ids on get_product
1 parent 18c0a62 commit e954002

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

amazon/paapi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@ def get_product(self, product_id, condition='Any', merchant='All',
158158
for the product or None if no results.
159159
"""
160160
if isinstance(product_id, list):
161-
raise AmazonException('TypeError', 'Arg product_id should be string')
161+
product_id = product_id[0]
162162
if isinstance(product_id, str):
163-
check_product_id = product_id.split(',')
164-
if len(check_product_id) > 1:
165-
raise AmazonException('ValueError', 'Only 1 product ID is allowed, use '
166-
'get_products for multiple requests')
163+
product_id = product_id.split(',')[0]
164+
167165
product = self.get_products(product_id, condition=condition, merchant=merchant,
168166
async_req=async_req)
169167
if product:

0 commit comments

Comments
 (0)