Browse Source

Minor code style changes

We're not sure if a valid id might ever be 0. And using all() is a
little less verbose.
master
Maik Hoepfel 12 years ago
parent
commit
6aaee8dd74
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      oscar/apps/basket/abstract_models.py

+ 2
- 5
oscar/apps/basket/abstract_models.py View File

@@ -344,10 +344,7 @@ class AbstractBasket(models.Model):
344 344
         """
345 345
         Test if tax values are known for this basket
346 346
         """
347
-        for line in self.all_lines():
348
-            if not line.is_tax_known:
349
-                return False
350
-        return True
347
+        return all([line.is_tax_known for line in self.all_lines()])
351 348
 
352 349
     @property
353 350
     def total_excl_tax(self):
@@ -485,7 +482,7 @@ class AbstractBasket(models.Model):
485 482
         """
486 483
         Test whether the basket contains a voucher with a given code
487 484
         """
488
-        if not self.id:
485
+        if self.id is None:
489 486
             return False
490 487
         try:
491 488
             self.vouchers.get(code=code)

Loading…
Cancel
Save