Skip to content

Commit 9f0ef5b

Browse files
authored
refactor: Reduce debug output (#171)
1 parent 540bf76 commit 9f0ef5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/viur/shop/types/dc_scope.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from viur.core.skeleton import RefSkel, SkeletonInstance, skeletonByKind
3434
from .enums import *
3535
from .exceptions import DispatchError, InvalidStateError
36-
from ..globals import SENTINEL, SHOP_INSTANCE, SHOP_LOGGER, Sentinel
36+
from ..globals import DEBUG_DISCOUNTS, SENTINEL, SHOP_INSTANCE, SHOP_LOGGER, Sentinel
3737
from ..services import HOOK_SERVICE, Hook
3838
from ..types import SkeletonInstance_T
3939

@@ -285,9 +285,9 @@ def is_fulfilled(self) -> bool:
285285
self._is_fulfilled = any(cv.is_fulfilled for cv in self.condition_validator_instances)
286286
elif self.discount_skel["condition_operator"] == ConditionOperator.ALL:
287287
logger.debug("Checking for all")
288-
logger.debug(f"{self.condition_validator_instances=}")
289-
290-
pprint.pprint(self.condition_validator_instances)
288+
if DEBUG_DISCOUNTS.get():
289+
logger.debug(f"{self.condition_validator_instances=}")
290+
pprint.pprint(self.condition_validator_instances)
291291
self._is_fulfilled = all(cv.is_fulfilled for cv in self.condition_validator_instances)
292292
else:
293293
raise InvalidStateError(f'Invalid condition operator: {self.discount_skel["condition_operator"]}')

0 commit comments

Comments
 (0)