Skip to content

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

Remove additional functions

Unknown25837a5ef22f
diff --git a/saleor/order/models.py b/saleor/order/models.py
index 3b2a389a1d..99bc63e361 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -176,29 +176,17 @@ class Order(models.Model):
def get_last_payment(self):
return max(self.payments.all(), default=None, key=attrgetter('pk'))
- def get_last_payment_status(self):
+ def get_payment_status(self):
last_payment = self.get_last_payment()
if last_payment:
- return last_payment.charge_status
- return None
+ return last_payment.get_charge_status_display()
+ return ChargeStatus.NOT_CHARGED
- def get_last_payment_status_display(self):
+ def get_payment_status_display(self):
last_payment = self.get_last_payment()
if last_payment:
return last_payment.get_charge_status_display()
- return None
-
- def get_payment_status(self):
- status = self.get_last_payment_status()
- if status is None:
- return ChargeStatus.NOT_CHARGED
- return status
-
- def get_payment_status_display(self):
- status = self.get_last_payment_status_display()
- if status is None:
- return dict(ChargeStatus.CHOICES).get(ChargeStatus.NOT_CHARGED)
- return status
+ return dict(ChargeStatus.CHOICES).get(ChargeStatus.NOT_CHARGED)
def is_pre_authorized(self):
return self.payments.filter(