mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Refactor and fix auth errors
This commit is contained in:
@@ -2,6 +2,6 @@ from flask import Blueprint
|
||||
|
||||
from app.v2.errors import register_errors
|
||||
|
||||
template_blueprint = Blueprint("v2_template", __name__, url_prefix='/v2/template')
|
||||
v2_template_blueprint = Blueprint("v2_template", __name__, url_prefix='/v2/template')
|
||||
|
||||
register_errors(template_blueprint)
|
||||
register_errors(v2_template_blueprint)
|
||||
|
||||
@@ -7,12 +7,12 @@ from werkzeug.exceptions import abort
|
||||
from app import api_user
|
||||
from app.dao import templates_dao
|
||||
from app.schema_validation import validate
|
||||
from app.v2.template import template_blueprint
|
||||
from app.v2.template import v2_template_blueprint
|
||||
from app.v2.template.template_schemas import get_template_by_id_request
|
||||
|
||||
|
||||
@template_blueprint.route("/<template_id>", methods=['GET'])
|
||||
@template_blueprint.route("/<template_id>/version/<int:version>", methods=['GET'])
|
||||
@v2_template_blueprint.route("/<template_id>", methods=['GET'])
|
||||
@v2_template_blueprint.route("/<template_id>/version/<int:version>", methods=['GET'])
|
||||
def get_template_by_id(template_id, version=None):
|
||||
try:
|
||||
_data = {}
|
||||
|
||||
@@ -9,11 +9,11 @@ from app.dao import templates_dao
|
||||
from app.schema_validation import validate
|
||||
from app.utils import get_template_instance
|
||||
from app.v2.errors import BadRequestError
|
||||
from app.v2.template import template_blueprint
|
||||
from app.v2.template import v2_template_blueprint
|
||||
from app.v2.template.template_schemas import post_template_preview_request, create_post_template_preview_response
|
||||
|
||||
|
||||
@template_blueprint.route("/<template_id>/preview", methods=['POST'])
|
||||
@v2_template_blueprint.route("/<template_id>/preview", methods=['POST'])
|
||||
def post_template_preview(template_id):
|
||||
try:
|
||||
_data = request.get_json()
|
||||
|
||||
Reference in New Issue
Block a user