Commits

marconius  committed 0c290fc

handle a none amount

  • Participants
  • Parent commits 50d2c2a

Comments (0)

Files changed (1)

File satchmo/apps/satchmo_store/shop/models.py

 class GlobalDiscountManager(models.Manager):
     
     def for_amount(self, amount):
+        if amount == None:
+            amount = Decimal("0")
         try:
             gds = GlobalDiscount.objects.filter(amount__lt=amount)
             maxd = gds.aggregate(models.Max('discount'))['discount__max']