Only return active SMS senders

Updated the DAO methods which return a single SMS sender and all SMS senders
to only return the non-archived senders. Changed the error raised in the Admin
interface from a SQLAlchemyError to a BadRequestError.
This commit is contained in:
Katie Smith
2018-04-25 14:23:00 +01:00
parent f810daa3c5
commit 663021e494
7 changed files with 77 additions and 19 deletions

View File

@@ -418,16 +418,18 @@ def create_reply_to_email(
def create_service_sms_sender(
service,
sms_sender,
is_default=True,
inbound_number_id=None
service,
sms_sender,
is_default=True,
inbound_number_id=None,
archived=False
):
data = {
'service_id': service.id,
'sms_sender': sms_sender,
'is_default': is_default,
'inbound_number_id': inbound_number_id
'inbound_number_id': inbound_number_id,
'archived': archived,
}
service_sms_sender = ServiceSmsSender(**data)