saleor-gql-loader icon indicating copy to clipboard operation
saleor-gql-loader copied to clipboard

Duplicated attribute values for product variant

Open ehutzle opened this issue 5 years ago • 4 comments

I was running your example code, it worked all the way up until I tried to create variants. I got this error

Traceback (most recent call last):
  File "<input>", line 9, in <module>
  File "~/saleor/venv/lib/python3.7/site-packages/saleor_gql_loader/data_loader.py", line 677, in create_product_variant
    handle_errors(errors)
  File "~/saleor/venv/lib/python3.7/site-packages/saleor_gql_loader/utils.py", line 143, in handle_errors
    raise Exception("\n".join(txt_list))
Exception: attributes : Duplicated attribute values for product variant.

ehutzle avatar May 28 '20 17:05 ehutzle

Have you made sure your attribute values are unique ?

grll avatar Jun 01 '20 17:06 grll

Have you made sure your attribute values are unique ?

Looks like I've fixed this, also not sure how to use GitHub yet, but I dropped in a function to handle multi-variant items.

ehutzle avatar Jun 01 '20 18:06 ehutzle

Hi @ehutzle I'm experiencing this same issue now. How were you able to fix it? Thank you

stevekrasinsky avatar Apr 15 '21 19:04 stevekrasinsky

Issue resolved. @grll there's a small typo in your example code. In the last step the first argument to create_product_variant is: product_id should actually be: product["id"]

Here's the link with the example code I'm referring to step 23:

https://github.com/grll/saleor-gql-loader/blob/master/saleor_gql_loader/example.ipynb

stevekrasinsky avatar Apr 16 '21 02:04 stevekrasinsky