Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/notification/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class Meta:
),
]

def __str__(self) -> str:
return f"[{self.code}] {self.title}"

@classmethod
def _to_dtl(cls, source: str) -> str:
return source
Expand Down Expand Up @@ -153,6 +156,9 @@ class NotificationHistoryBase(BaseAbstractModel):
class Meta:
abstract = True

def __str__(self) -> str:
return f"{self.template_code or '-'} by {self.created_by}"

@property
def template_code(self) -> str:
return self.template.code if self.template_id else ""
Expand Down Expand Up @@ -212,6 +218,9 @@ class Meta:
),
]

def __str__(self) -> str:
return f"{self.recipient} ({self.get_status_display()})"

def _parsed_template_data(self) -> Any:
try:
return json_loads(self.history.template_data)
Expand Down
Loading