Order list export: Expose same "extended status" as in backend (#3674)

* Order list export: Expose same "extended status" as in backend

* Review notes
This commit is contained in:
Raphael Michel
2023-11-15 15:20:30 +01:00
committed by GitHub
parent a631890db1
commit 77da4052b9
4 changed files with 17 additions and 3 deletions

View File

@@ -325,6 +325,18 @@ class Order(LockModel, LoggedModel):
def email_confirm_hash(self):
return hashlib.sha256(settings.SECRET_KEY.encode() + self.secret.encode()).hexdigest()[:9]
def get_extended_status_display(self):
# Changes in this method should to be replicated in pretixcontrol/orders/fragment_order_status.html
# and pretixpresale/event/fragment_order_status.html
if self.status == Order.STATUS_PENDING:
if self.require_approval:
return _("approval pending")
elif self.valid_if_pending:
return pgettext_lazy("order state", "pending (confirmed)")
elif self.status == Order.STATUS_PAID and self.count_positions == 0:
return _("canceled (paid fee)")
return self.get_status_display()
@property
def fees(self):
"""