notify-api-412 use black to enforce python style standards

This commit is contained in:
Kenneth Kehl
2023-08-23 10:35:43 -07:00
parent a7898118d7
commit 026dc14021
586 changed files with 33990 additions and 23461 deletions

View File

@@ -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)

View File

@@ -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,
)

View File

@@ -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},
}