Skip to content

Commit 27405dd

Browse files
committed
cleanup
1 parent 7c12e1f commit 27405dd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/viur/shop/modules/cart.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
from viur.core.prototypes import Tree
88
from viur.core.prototypes.tree import SkelType
99
from viur.core.session import Session
10-
from viur.core.skeleton import Skeleton, SkeletonInstance, without_render_preparation
10+
from viur.core.skeleton import Skeleton, SkeletonInstance
1111
from viur.shop.modules.abstract import ShopModuleAbstract
1212
from viur.shop.types import *
1313
from viur.shop.types.exceptions import InvalidStateError
14+
1415
from ..globals import MAX_FETCH_LIMIT, SENTINEL, SHOP_INSTANCE, SHOP_LOGGER
1516
from ..services import EVENT_SERVICE, Event
1617
from ..skeletons.article import ArticleAbstractSkel
@@ -19,6 +20,11 @@
1920

2021
logger = SHOP_LOGGER.getChild(__name__)
2122

23+
if conf.version >= (3, 8, 15): # TODO: 3,8,16
24+
from viur.core.skeleton.utils import without_render_preparation
25+
else:
26+
from viur.toolkit import without_render_preparation
27+
2228

2329
class Cart(ShopModuleAbstract, Tree):
2430
moduleName = "cart"

src/viur/shop/skeletons/cart.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,7 @@ def article_skel_full(self) -> SkeletonInstance_T[ArticleAbstractSkel]:
446446
except KeyError:
447447
# logger.debug(f'Read article_skel_full {self.article_skel["key"]=}')
448448
skel = SHOP_INSTANCE.get().article_skel()
449-
res = skel.read(self.article_skel["key"])
450-
logger.info(f"skel.read {res=}")
451-
assert res
449+
assert skel.read(self.article_skel["key"]) is not None
452450
CartItemSkel.get_article_cache()[self.article_skel["key"]] = skel
453451
return skel
454452

0 commit comments

Comments
 (0)