Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change comment

Adam Bogdałcafb08300228
diff --git a/saleor/order/models.py b/saleor/order/models.py
index 045ee47506..f147d7f12d 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -319,13 +319,10 @@ class OrderedItem(models.Model, ItemLine):
class PaymentManager(models.Manager):
def last(self):
- """
- Returns the last object without touching db
- """
+ # using .all() here reuses data fetched by prefetch_related
objects = list(self.all()[:1])
if objects:
return objects[0]
- return None
class Payment(BasePayment):