models: Rename _type to recipient_type_str.

This commit is contained in:
Aman Agrawal 2023-04-14 19:06:51 +00:00 committed by Tim Abbott
parent b63f440fb1
commit a0eac4aaf4
1 changed files with 4 additions and 4 deletions

View File

@ -3156,13 +3156,13 @@ class Draft(models.Model):
def to_dict(self) -> Dict[str, Any]:
if self.recipient is None:
_type = ""
recipient_type_str = ""
to = []
elif self.recipient.type == Recipient.STREAM:
_type = "stream"
recipient_type_str = "stream"
to = [self.recipient.type_id]
else:
_type = "private"
recipient_type_str = "private"
if self.recipient.type == Recipient.PERSONAL:
to = [self.recipient.type_id]
else:
@ -3173,7 +3173,7 @@ class Draft(models.Model):
to.append(r["id"])
return {
"id": self.id,
"type": _type,
"type": recipient_type_str,
"to": to,
"topic": self.topic,
"content": self.content,