Skip to content

Commit

Permalink
Fixed a few issues caused by optimisation of basket queries
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinthehole committed Jul 24, 2012
1 parent 0ec010a commit 7e08855
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oscar/apps/basket/abstract_models.py
Expand Up @@ -3,6 +3,7 @@
import datetime

from django.db import models
from django.db.models import query
from django.utils.translation import ugettext as _
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied

Expand Down Expand Up @@ -64,7 +65,7 @@ def all_lines(self):
want to reload them from the DB.
"""
if self.id is None:
return []
return query.EmptyQuerySet(model=self.__class__)
if self._lines is None:
self._lines = self.lines.all()
return self._lines
Expand Down

0 comments on commit 7e08855

Please sign in to comment.