mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Remove all DAO get service calls, replaced with reference to new service object in context.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
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.schema_validation import validate
|
||||
from app.v2.templates import v2_templates_blueprint
|
||||
@@ -12,7 +11,7 @@ from app.v2.templates.templates_schemas import get_all_template_request
|
||||
def get_templates():
|
||||
data = validate(request.args.to_dict(), get_all_template_request)
|
||||
|
||||
templates = templates_dao.dao_get_all_templates_for_service(api_user.service_id, data.get('type'))
|
||||
templates = templates_dao.dao_get_all_templates_for_service(authenticated_service.id, data.get('type'))
|
||||
|
||||
return jsonify(
|
||||
templates=[template.serialize() for template in templates]
|
||||
|
||||
Reference in New Issue
Block a user