mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
notify-api-412 use black to enforce python style standards
This commit is contained in:
@@ -2,6 +2,6 @@ from flask import Blueprint
|
||||
|
||||
from app.v2.errors import register_errors
|
||||
|
||||
v2_templates_blueprint = Blueprint("v2_templates", __name__, url_prefix='/v2/templates')
|
||||
v2_templates_blueprint = Blueprint("v2_templates", __name__, url_prefix="/v2/templates")
|
||||
|
||||
register_errors(v2_templates_blueprint)
|
||||
|
||||
@@ -7,12 +7,15 @@ from app.v2.templates import v2_templates_blueprint
|
||||
from app.v2.templates.templates_schemas import get_all_template_request
|
||||
|
||||
|
||||
@v2_templates_blueprint.route("", methods=['GET'])
|
||||
@v2_templates_blueprint.route("", methods=["GET"])
|
||||
def get_templates():
|
||||
data = validate(request.args.to_dict(), get_all_template_request)
|
||||
|
||||
templates = templates_dao.dao_get_all_templates_for_service(authenticated_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_v2() for template in templates]
|
||||
), 200
|
||||
return (
|
||||
jsonify(templates=[template.serialize_for_v2() for template in templates]),
|
||||
200,
|
||||
)
|
||||
|
||||
@@ -7,9 +7,7 @@ get_all_template_request = {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "request schema for parameters allowed when getting all templates",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": TEMPLATE_TYPES}
|
||||
},
|
||||
"properties": {"type": {"enum": TEMPLATE_TYPES}},
|
||||
"additionalProperties": False,
|
||||
}
|
||||
|
||||
@@ -20,14 +18,9 @@ get_all_template_response = {
|
||||
"properties": {
|
||||
"templates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/template"
|
||||
}
|
||||
"items": {"type": "object", "$ref": "#/definitions/template"},
|
||||
}
|
||||
},
|
||||
"required": ["templates"],
|
||||
"definitions": {
|
||||
"template": template
|
||||
}
|
||||
"definitions": {"template": template},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user