Add order by in the dao_get_reply_to_by_service_id()

This commit is contained in:
Rebecca Law
2017-09-22 10:02:59 +01:00
parent 9bc1d13785
commit 03ea09fd6a
2 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
from sqlalchemy import desc
from app import db
from app.dao.dao_utils import transactional
from app.errors import InvalidRequest
@@ -9,7 +11,7 @@ def dao_get_reply_to_by_service_id(service_id):
ServiceEmailReplyTo
).filter(
ServiceEmailReplyTo.service_id == service_id
).order_by(ServiceEmailReplyTo.created_at).all()
).order_by(desc(ServiceEmailReplyTo.is_default), desc(ServiceEmailReplyTo.created_at)).all()
return reply_to