mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Refactored to make email and sms template check the same
This commit is contained in:
@@ -49,9 +49,12 @@ def create_sms_notification():
|
|||||||
if errors:
|
if errors:
|
||||||
return jsonify(result="error", message=errors), 400
|
return jsonify(result="error", message=errors), 400
|
||||||
|
|
||||||
try:
|
template = templates_dao.dao_get_template_by_id_and_service_id(
|
||||||
templates_dao.get_model_templates(template_id=notification['template'], service_id=api_user['client'])
|
template_id=notification['template'],
|
||||||
except NoResultFound:
|
service_id=api_user['client']
|
||||||
|
)
|
||||||
|
|
||||||
|
if not template:
|
||||||
return jsonify(result="error", message={'template': ['Template not found']}), 400
|
return jsonify(result="error", message={'template': ['Template not found']}), 400
|
||||||
|
|
||||||
service = services_dao.dao_fetch_service_by_id(api_user['client'])
|
service = services_dao.dao_fetch_service_by_id(api_user['client'])
|
||||||
|
|||||||
Reference in New Issue
Block a user