handle case where alias does not have any activity in get_alias_infos_with_pagination_v3
This commit is contained in:
parent
30fe09185f
commit
d7583f1733
|
@ -232,13 +232,16 @@ def get_alias_infos_with_pagination_v3(
|
||||||
.subquery()
|
.subquery()
|
||||||
)
|
)
|
||||||
|
|
||||||
q = db.session.query(
|
q = (
|
||||||
Alias, Contact, EmailLog, sub.c.nb_reply, sub.c.nb_blocked, sub.c.nb_forward
|
db.session.query(
|
||||||
).filter(
|
Alias, Contact, EmailLog, sub.c.nb_reply, sub.c.nb_blocked, sub.c.nb_forward
|
||||||
Alias.id == sub.c.id,
|
)
|
||||||
Alias.id == Contact.alias_id,
|
.join(Contact, Alias.id == Contact.alias_id, isouter=True)
|
||||||
Contact.id == EmailLog.contact_id,
|
.join(EmailLog, Contact.id == EmailLog.contact_id, isouter=True)
|
||||||
EmailLog.created_at == sub.c.latest,
|
.filter(Alias.id == sub.c.id)
|
||||||
|
.filter(
|
||||||
|
or_(EmailLog.created_at == sub.c.latest, Alias.created_at == sub.c.latest)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if query:
|
if query:
|
||||||
|
|
Loading…
Reference in a new issue