Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #190 from baffolobill/criteria-models-bugs

Fixes bugs in criteria.models
commit 6e9e3a6ae12a0bc9302a757b64c056a317daec7d 2 parents 5f1d50a + 627d7a2
@pigletto pigletto authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 lfs/criteria/models.py
View
10 lfs/criteria/models.py
@@ -627,7 +627,7 @@ def get_value_type(self):
def is_valid(self):
# see ShippingMethodCriterion for what's going on here
- import lfs.shipping.utils
+ import lfs.payment.utils
if isinstance(self.content, PaymentMethod):
is_payment_method = True
else:
@@ -641,12 +641,12 @@ def is_valid(self):
return payment_method not in self.value.all()
elif self.operator == self.IS_VALID:
for pm in self.value.all():
- if not lfs.criteria.utils.is_valid(self.request, pm, self.product):
+ if not pm.is_valid(self.request, self.product):
return False
return True
elif self.operator == self.IS_NOT_VALID:
for pm in self.value.all():
- if lfs.criteria.utils.is_valid(self.request, pm, self.product):
+ if pm.is_valid(self.request, self.product):
return False
return True
else:
@@ -709,12 +709,12 @@ def is_valid(self):
return shipping_method not in self.value.all()
elif self.operator == self.IS_VALID:
for sm in self.value.all():
- if not lfs.criteria.utils.is_valid(self.request, sm, self.product):
+ if not sm.is_valid(self.request, self.product):
return False
return True
elif self.operator == self.IS_NOT_VALID:
for sm in self.value.all():
- if lfs.criteria.utils.is_valid(self.request, sm, self.product):
+ if sm.is_valid(self.request, self.product):
return False
return True
else:
Please sign in to comment.
Something went wrong with that request. Please try again.