mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Handle HTTPError from API and routing errors from flask.
Removed catching the HTTPError where applicable.
This commit is contained in:
@@ -19,10 +19,7 @@ def get_service_templates(service_id):
|
||||
|
||||
|
||||
def get_service_template_or_404(service_id, template_id):
|
||||
try:
|
||||
return notifications_api_client.get_service_template(service_id, template_id)
|
||||
except HTTPError as e:
|
||||
abort(e.status_code)
|
||||
return notifications_api_client.get_service_template(service_id, template_id)
|
||||
|
||||
|
||||
def delete_service_template(service_id, template_id):
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
from datetime import datetime
|
||||
from notifications_python_client import HTTPError
|
||||
|
||||
from sqlalchemy.orm import load_only
|
||||
|
||||
from app import login_manager
|
||||
from app.main.encryption import hashpw
|
||||
|
||||
from app import user_api_client
|
||||
|
||||
#
|
||||
|
||||
@@ -9,7 +9,6 @@ from flask_login import login_required
|
||||
from app.main import main
|
||||
from app.main.dao.services_dao import get_service_by_id
|
||||
from app.main.dao import templates_dao
|
||||
from notifications_python_client.errors import HTTPError
|
||||
from app import job_api_client
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ from flask import (
|
||||
jsonify
|
||||
)
|
||||
from flask_login import login_required
|
||||
from notifications_python_client.errors import HTTPError
|
||||
from utils.template import Template
|
||||
|
||||
from app import job_api_client, notification_api_client
|
||||
|
||||
Reference in New Issue
Block a user