Skip to content

Commit 2600a5b

Browse files
committed
fix
1 parent 3649387 commit 2600a5b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/viur/shop/modules/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ def _normalize_external_key(
541541
return None
542542
elif not external_key:
543543
raise InvalidKeyException(external_key, parameter_name)
544+
if isinstance(external_key, db.Key):
545+
return external_key
544546
try:
545547
return db.Key.from_legacy_urlsafe(external_key)
546548
except (ValueError, DecodeError): # yes, the exception really comes from protobuf...

src/viur/shop/modules/cart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def canView(self, skelType: SkelType, skel: SkeletonInstance) -> bool:
5858

5959
@property
6060
def current_session_cart_key(self) -> db.Key | None:
61-
return self.get_current_session_cart_key()
61+
return self.get_current_session_cart_key(create_if_missing=False)
6262

6363
def get_current_session_cart_key(self, *, create_if_missing: bool = False) -> db.Key | None:
6464
if user := current.user.get():

0 commit comments

Comments
 (0)