Skip to content

Commit 967b07e

Browse files
committed
fix: AddressType can be sub-classed...
... introduction if Enums as SelectBone-values in ViUR was a really bad idea.
1 parent 030a10b commit 967b07e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/viur/shop/modules/cart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ 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 (addr.value for addr in skel["shipping_address"]["dest"]["address_type"]):
504504
raise e.InvalidArgumentException(
505505
"shipping_address",
506506
descr_appendix="Address is not of type shipping."

src/viur/shop/modules/order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ 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 (addr.value for addr in skel["billing_address"]["dest"]["address_type"]):
232232
raise e.InvalidArgumentException(
233233
"billing_address",
234234
descr_appendix="Address is not of type billing."

0 commit comments

Comments
 (0)