Skip to content

Commit 8e56417

Browse files
Add cost to MESSAGE_SELECT
1 parent be7c673 commit 8e56417

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/schemas/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Message(BaseModel):
4040
subject: Optional[str] = ''
4141
body: Optional[str] = ''
4242
attachments: Optional[List[str]] = []
43-
cost: float = 0
43+
cost: Optional[float] = 0
4444
extra: Json
4545
vector: Optional[str] = ''
4646

@@ -71,7 +71,7 @@ def parsed_details(self):
7171
'update_ts': self.update_ts,
7272
'status': self.get_status_display(),
7373
'method': self.method,
74-
'cost': self.cost,
74+
'cost': self.cost or 0,
7575
}
7676

7777
def get_attachments(self):

src/views/messages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
V('status'),
3838
V('method'),
3939
V('attachments'),
40+
V('cost'),
4041
]
4142
)
4243

0 commit comments

Comments
 (0)