Browse Source

Minor performance tweak for promotions

master
David Winterbottom 14 years ago
parent
commit
026731a385

+ 0
- 1
oscar/apps/basket/abstract_models.py View File

@@ -33,7 +33,6 @@ class AbstractBasket(models.Model):
33 33
     date_created = models.DateTimeField(auto_now_add=True)
34 34
     date_merged = models.DateTimeField(null=True, blank=True)
35 35
     date_submitted = models.DateTimeField(null=True, blank=True)
36
-
37 36
     
38 37
     class Meta:
39 38
         abstract = True

+ 3
- 2
oscar/apps/promotions/context_processors.py View File

@@ -36,12 +36,13 @@ def _split_by_position(linked_promotions, context):
36 36
     by position, and write these lists to the context dict.
37 37
     """
38 38
     for linked_promotion in linked_promotions:
39
-        if not linked_promotion.content_object:
39
+        promotion = linked_promotion.content_object
40
+        if not promotion:
40 41
             continue
41 42
         key = 'promotions_%s' % linked_promotion.position.lower()
42 43
         if key not in context:
43 44
             context[key] = []
44
-        context[key].append(linked_promotion.content_object)
45
+        context[key].append(promotion)
45 46
       
46 47
 
47 48
 

Loading…
Cancel
Save