mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
retention: Add __str__ method to ArchiveTransaction.
This commit is contained in:
committed by
Tim Abbott
parent
c869ea8e1e
commit
5b20317379
@@ -1533,6 +1533,14 @@ class ArchiveTransaction(models.Model):
|
||||
# If type is set to MANUAL, this should be null.
|
||||
realm = models.ForeignKey(Realm, null=True, on_delete=CASCADE) # type: Optional[Realm]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "ArchiveTransaction id: {id}, type: {type}, realm: {realm}, timestamp: {timestamp}".format(
|
||||
id=self.id,
|
||||
type="MANUAL" if self.type == self.MANUAL else "RETENTION_POLICY_BASED",
|
||||
realm=self.realm.string_id if self.realm else None,
|
||||
timestamp=self.timestamp
|
||||
)
|
||||
|
||||
class ArchivedMessage(AbstractMessage):
|
||||
"""Used as a temporary holding place for deleted messages before they
|
||||
are permanently deleted. This is an important part of a robust
|
||||
|
||||
Reference in New Issue
Block a user