Skip to content

Commit

Permalink
removed debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear committed Sep 28, 2023
1 parent 49742e2 commit 496f91b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion oscarapi/serializers/admin/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def update(self, instance, validated_data):
attribute__product_class=product_class
):
code = attribute_value.attribute.code
print("moet je peopen", code, "harrie", pclass_option_codes)
if (
code in attribute_codes
): # if the attribute exist also on the new product class, update the attribute
Expand Down
6 changes: 0 additions & 6 deletions oscarapi/serializers/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ def to_internal_value(self, data):
product_class, code = getitems(item, "product_class", "code")
if product_class:
productclasses.add(product_class)
# if code:
# attributes.add(code)

print(productclasses)
# if all attributes belong to the same productclass, everything is just
# as expected and we can do an optimization by only resolving the productclass to the model instance and nothing else.
try:
Expand Down Expand Up @@ -251,18 +248,15 @@ def update(self, instance, validated_data):
attr_codes = []
product.attr.initialize()
for validated_datum in validated_data:
print(validated_datum)
# leave all the attribute saving to the ProductAttributesContainer instead
# of the child serializers
attribute, value = getitems(validated_datum, "attribute", "value")
if hasattr(
attribute, "code"
): # if the attribute is a model instance use the code
print(" i set dem pussyes")
product.attr.set(attribute.code, value)
attr_codes.append(attribute.code)
else:
print(" set dem reten")
product.attr.set(attribute, value)
attr_codes.append(attribute)

Expand Down

0 comments on commit 496f91b

Please sign in to comment.