Skip to content

Commit 23ae545

Browse files
committed
Variant Bug
1 parent 2600974 commit 23ae545

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

util/printify_util.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ def get_all_variants(self, blueprint_id, print_provider_id):
104104
case _:
105105
price = self.extended_size_price
106106
continue
107-
if variant['options']['color'] not in [
108-
"Black", "White", "Red", "Blue", "Green", "Yellow", "Pink", "Orange", "purple"
109-
]:
110-
continue
107+
# if variant['options']['color'] not in [
108+
# "Black", "White", "Red", "Blue", "Green", "Yellow", "Pink", "Orange", "purple"
109+
# ]:
110+
# continue
111111
return_response.append({
112112
'id': variant['id'],
113113
# 'color': variant['options']['color'],
@@ -191,7 +191,14 @@ def create_product(self, blueprint_id, print_provider_id, variants, image_id):
191191
# # write response to a file
192192
# with open("product.json", "wb") as file:
193193
# file.write(response.text.encode('utf-8'))
194-
194+
# TODO - This is what needs to be done for this PR
195+
# WOW CAN'T BELIEVE I HAVE TO DO THIS
196+
# Get product by Product ID
197+
# parse the variants in the product
198+
# if variant `is_available` is false, add it to the removal list
199+
# update the product with all vaiants except for those that are not available
200+
201+
195202
else:
196203
print(f"Failed to create product. Status code: {response.status_code}")
197204
return None

0 commit comments

Comments
 (0)