rename
This commit is contained in:
parent
f7e5ab1e34
commit
3baddc9206
|
@ -236,19 +236,19 @@ def get_alias(alias_id):
|
||||||
return jsonify(**serialize_alias_info(get_alias_info(alias))), 200
|
return jsonify(**serialize_alias_info(get_alias_info(alias))), 200
|
||||||
|
|
||||||
|
|
||||||
def serialize_contact(fe: Contact) -> dict:
|
def serialize_contact(contact: Contact) -> dict:
|
||||||
|
|
||||||
res = {
|
res = {
|
||||||
"id": fe.id,
|
"id": contact.id,
|
||||||
"creation_date": fe.created_at.format(),
|
"creation_date": contact.created_at.format(),
|
||||||
"creation_timestamp": fe.created_at.timestamp,
|
"creation_timestamp": contact.created_at.timestamp,
|
||||||
"last_email_sent_date": None,
|
"last_email_sent_date": None,
|
||||||
"last_email_sent_timestamp": None,
|
"last_email_sent_timestamp": None,
|
||||||
"contact": fe.website_from or fe.website_email,
|
"contact": contact.website_from or contact.website_email,
|
||||||
"reverse_alias": fe.website_send_to(),
|
"reverse_alias": contact.website_send_to(),
|
||||||
}
|
}
|
||||||
|
|
||||||
email_log: EmailLog = fe.last_reply()
|
email_log: EmailLog = contact.last_reply()
|
||||||
if email_log:
|
if email_log:
|
||||||
res["last_email_sent_date"] = email_log.created_at.format()
|
res["last_email_sent_date"] = email_log.created_at.format()
|
||||||
res["last_email_sent_timestamp"] = email_log.created_at.timestamp
|
res["last_email_sent_timestamp"] = email_log.created_at.timestamp
|
||||||
|
|
Loading…
Reference in a new issue