producteca 2.0.39__tar.gz → 2.0.40__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of producteca might be problematic. Click here for more details.

Files changed (31) hide show
  1. {producteca-2.0.39 → producteca-2.0.40}/PKG-INFO +1 -1
  2. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/products.py +4 -5
  3. {producteca-2.0.39 → producteca-2.0.40}/pyproject.toml +1 -1
  4. {producteca-2.0.39 → producteca-2.0.40}/LICENSE +0 -0
  5. {producteca-2.0.39 → producteca-2.0.40}/README.md +0 -0
  6. {producteca-2.0.39 → producteca-2.0.40}/producteca/__init__.py +0 -0
  7. {producteca-2.0.39 → producteca-2.0.40}/producteca/abstract/__init__.py +0 -0
  8. {producteca-2.0.39 → producteca-2.0.40}/producteca/abstract/abstract_dataclass.py +0 -0
  9. {producteca-2.0.39 → producteca-2.0.40}/producteca/client.py +0 -0
  10. {producteca-2.0.39 → producteca-2.0.40}/producteca/config/__init__.py +0 -0
  11. {producteca-2.0.39 → producteca-2.0.40}/producteca/config/config.py +0 -0
  12. {producteca-2.0.39 → producteca-2.0.40}/producteca/payments/__init__.py +0 -0
  13. {producteca-2.0.39 → producteca-2.0.40}/producteca/payments/payments.py +0 -0
  14. {producteca-2.0.39 → producteca-2.0.40}/producteca/payments/tests/__init__.py +0 -0
  15. {producteca-2.0.39 → producteca-2.0.40}/producteca/payments/tests/test_payments.py +0 -0
  16. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/__init__.py +0 -0
  17. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/search_products.py +0 -0
  18. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/tests/__init__.py +0 -0
  19. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/tests/test_products.py +0 -0
  20. {producteca-2.0.39 → producteca-2.0.40}/producteca/products/tests/test_search_products.py +0 -0
  21. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/__init__.py +0 -0
  22. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/sales_orders.py +0 -0
  23. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/search_sale_orders.py +0 -0
  24. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/tests/__init__.py +0 -0
  25. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/tests/search.json +0 -0
  26. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/tests/test_sales_orders.py +0 -0
  27. {producteca-2.0.39 → producteca-2.0.40}/producteca/sales_orders/tests/test_search_so.py +0 -0
  28. {producteca-2.0.39 → producteca-2.0.40}/producteca/shipments/__init__.py +0 -0
  29. {producteca-2.0.39 → producteca-2.0.40}/producteca/shipments/shipment.py +0 -0
  30. {producteca-2.0.39 → producteca-2.0.40}/producteca/shipments/tests/__init__.py +0 -0
  31. {producteca-2.0.39 → producteca-2.0.40}/producteca/shipments/tests/test_shipment.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: producteca
3
- Version: 2.0.39
3
+ Version: 2.0.40
4
4
  Summary:
5
5
  Author: Chroma Agency, Matias Rivera
6
6
  Author-email: mrivera@chroma.agency
@@ -262,6 +262,10 @@ class ProductService(BaseService):
262
262
  raise Exception("Sku or code should be provided to update the product")
263
263
  data = product_variation.model_dump(by_alias=True, exclude_none=True)
264
264
  response = requests.post(endpoint_url, json=data, headers=headers)
265
+ if not response.ok:
266
+ raise Exception(f"Error getting product {product_variation.sku} - {product_variation.code}\n {response.text}")
267
+ if response.status_code == 204:
268
+ raise Exception("Status code is 204, meaning nothing was updated or created")
265
269
  response_data = response.json()
266
270
  try:
267
271
  return Product(**response_data)
@@ -286,11 +290,6 @@ class ProductService(BaseService):
286
290
  raise Exception(f"Errored with the following message {error_res.message} - {error_res.model_dump_json()}")
287
291
  except ValidationError:
288
292
  pass
289
-
290
- if not response.ok:
291
- raise Exception(f"Error getting product {product_variation.sku} - {product_variation.code}\n {response.text}")
292
- if response.status_code == 204:
293
- raise Exception("Status code is 204, meaning nothing was updated or created")
294
293
  raise Exception(f"Unhandled error, check response {response.text}")
295
294
 
296
295
  def get(self, product_id: int) -> "ProductService":
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "producteca"
3
- version = "2.0.39"
3
+ version = "2.0.40"
4
4
  description = ""
5
5
  authors = ["Chroma Agency, Matias Rivera <mrivera@chroma.agency>"]
6
6
  readme = "README.md"
File without changes
File without changes