Sfoglia il codice sorgente

Return ProductAttributeValue even if it's None

master
Krzysiek Szularz 13 anni fa
parent
commit
70f515d157
1 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  1. 4
    5
      oscar/apps/catalogue/abstract_models.py

+ 4
- 5
oscar/apps/catalogue/abstract_models.py Vedi File

@@ -491,11 +491,10 @@ class ProductAttributesContainer(object):
491 491
                 if v.attribute.code == name:
492 492
                     result = v.value
493 493
             self.initialised = True
494
-            if result:
495
-                return result
496
-        raise AttributeError((_("%(obj)s has no attribute named " \
497
-                                "'%(attr)s'") % \
498
-                              {'obj': self.product.product_class, 'attr': name}))
494
+            return result
495
+        raise AttributeError(
496
+            _("%(obj)s has no attribute named '%(attr)s'") % {
497
+                'obj': self.product.product_class, 'attr': name})
499 498
 
500 499
     def validate_attributes(self):
501 500
         for attribute in self.get_all_attributes():

Loading…
Annulla
Salva