Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add missing return values

Maciej Korycinski89b47ec18e59
diff --git a/saleor/plugins/avatax/plugin.py b/saleor/plugins/avatax/plugin.py
index 8068e38cb4..7708d61786 100644
--- a/saleor/plugins/avatax/plugin.py
+++ b/saleor/plugins/avatax/plugin.py
@@ -401,15 +401,16 @@ class AvataxPlugin(BasePlugin):
if tax_code is None and obj.pk:
obj.delete_value_from_metadata(META_CODE_KEY)
obj.delete_value_from_metadata(META_DESCRIPTION_KEY)
- return
+ return previous_value
codes = get_cached_tax_codes_or_fetch(self.config)
if tax_code not in codes:
- return
+ return previous_value
tax_description = codes.get(tax_code)
tax_item = {META_CODE_KEY: tax_code, META_DESCRIPTION_KEY: tax_description}
obj.store_value_in_metadata(items=tax_item)
+ return previous_value
def get_tax_code_from_object_meta(
self, obj: Union["Product", "ProductType"], previous_value: Any
diff --git a/saleor/plugins/vatlayer/plugin.py b/saleor/plugins/vatlayer/plugin.py
index d1d1f3dcf0..58f537f377 100644
--- a/saleor/plugins/vatlayer/plugin.py
+++ b/saleor/plugins/vatlayer/plugin.py
@@ -247,7 +247,7 @@ class VatlayerPlugin(BasePlugin):
if tax_code is None and obj.pk:
obj.delete_value_from_metadata(self.META_CODE_KEY)
obj.delete_value_from_metadata(self.META_DESCRIPTION_KEY)
- return
+ return previous_value
if tax_code not in dict(TaxRateType.CHOICES):
return previous_value