style: 统一处理历史状态展示口径

This commit is contained in:
2026-06-04 03:57:03 +08:00
parent 7c0dfe14d5
commit 8ec254c393
5 changed files with 101 additions and 25 deletions

View File

@@ -99,3 +99,11 @@ class NotificationRecord(models.Model):
def __str__(self) -> str:
return f"{self.notify_reason}:{self.batch_id}"
def get_message_status_display_text(self) -> str:
"""返回通知状态的中文展示文案。"""
return {
self.STATUS_PENDING: "处理中",
self.STATUS_SENT: "已发送",
self.STATUS_FAILED: "失败",
}.get(self.message_status, self.message_status)