Skip to content

Commit 3bd61b9

Browse files
authored
fix: AddressType can be sub-classed... (#157)
... introduction if Enums as SelectBone-values in ViUR was a really bad idea.
1 parent 030a10b commit 3bd61b9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/viur/shop/modules/cart.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,9 @@ def _cart_set_values(
500500
skel["shipping_address"] = None
501501
else:
502502
skel.setBoneValue("shipping_address", shipping_address_key)
503-
if AddressType.SHIPPING not in skel["shipping_address"]["dest"]["address_type"]:
503+
if AddressType.SHIPPING.value not in (
504+
addr.value for addr in skel["shipping_address"]["dest"]["address_type"]
505+
):
504506
raise e.InvalidArgumentException(
505507
"shipping_address",
506508
descr_appendix="Address is not of type shipping."

src/viur/shop/modules/order.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ def _order_set_values(
228228
skel["billing_address"] = None
229229
else:
230230
skel.setBoneValue("billing_address", billing_address_key)
231-
if AddressType.BILLING not in skel["billing_address"]["dest"]["address_type"]:
231+
if AddressType.BILLING.value not in (
232+
addr.value for addr in skel["billing_address"]["dest"]["address_type"]
233+
):
232234
raise e.InvalidArgumentException(
233235
"billing_address",
234236
descr_appendix="Address is not of type billing."

src/viur/shop/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# For pre-releases, postfix with ".betaN" or ".rcN" where `N` is an incremented number for each pre-release.
33
# This will mark it as a pre-release as well on PyPI.
44

5-
__version__ = "0.8.0"
5+
__version__ = "0.8.1"
66

77
assert __version__.count(".") >= 2 and "".join(__version__.split(".", 3)[:3]).isdigit(), \
88
"Semantic __version__ expected!"

0 commit comments

Comments
 (0)