mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Remove all DAO get service calls, replaced with reference to new service object in context.
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
from flask import jsonify, request
|
||||
from jsonschema.exceptions import ValidationError
|
||||
|
||||
from app import api_user
|
||||
from app import authenticated_service
|
||||
from app.dao import templates_dao
|
||||
from app.models import SMS_TYPE
|
||||
from app.schema_validation import validate
|
||||
from app.utils import get_template_instance
|
||||
from app.v2.errors import BadRequestError
|
||||
@@ -22,7 +20,7 @@ def post_template_preview(template_id):
|
||||
data = validate(_data, post_template_preview_request)
|
||||
|
||||
template = templates_dao.dao_get_template_by_id_and_service_id(
|
||||
template_id, api_user.service_id)
|
||||
template_id, authenticated_service.id)
|
||||
|
||||
template_object = get_template_instance(
|
||||
template.__dict__, values=data.get('personalisation'))
|
||||
|
||||
Reference in New Issue
Block a user