style: 统一处理历史状态展示口径
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user