mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 02:49:42 -04:00
Run auto-correct on app/ and tests/
This commit is contained in:
112
app/__init__.py
112
app/__init__.py
@@ -1,22 +1,30 @@
|
||||
import time
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
import time
|
||||
import uuid
|
||||
from time import monotonic
|
||||
|
||||
from celery import current_task
|
||||
from flask import _request_ctx_stack, request, g, jsonify, make_response, current_app, has_request_context
|
||||
from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy
|
||||
from flask import (
|
||||
_request_ctx_stack,
|
||||
current_app,
|
||||
g,
|
||||
has_request_context,
|
||||
jsonify,
|
||||
make_response,
|
||||
request,
|
||||
)
|
||||
from flask_marshmallow import Marshmallow
|
||||
from flask_migrate import Migrate
|
||||
from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy
|
||||
from gds_metrics import GDSMetrics
|
||||
from gds_metrics.metrics import Gauge, Histogram
|
||||
from time import monotonic
|
||||
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
||||
from notifications_utils.clients.statsd.statsd_client import StatsdClient
|
||||
from notifications_utils.clients.redis.redis_client import RedisClient
|
||||
from notifications_utils.clients.encryption.encryption_client import Encryption
|
||||
from notifications_utils import logging, request_helper
|
||||
from notifications_utils.clients.encryption.encryption_client import Encryption
|
||||
from notifications_utils.clients.redis.redis_client import RedisClient
|
||||
from notifications_utils.clients.statsd.statsd_client import StatsdClient
|
||||
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
||||
from sqlalchemy import event
|
||||
from werkzeug.exceptions import HTTPException as WerkzeugHTTPException
|
||||
from werkzeug.local import LocalProxy
|
||||
@@ -27,9 +35,11 @@ from app.clients.cbc_proxy import CBCProxyClient
|
||||
from app.clients.document_download import DocumentDownloadClient
|
||||
from app.clients.email.aws_ses import AwsSesClient
|
||||
from app.clients.email.aws_ses_stub import AwsSesStubClient
|
||||
from app.clients.performance_platform.performance_platform_client import (
|
||||
PerformancePlatformClient,
|
||||
)
|
||||
from app.clients.sms.firetext import FiretextClient
|
||||
from app.clients.sms.mmg import MMGClient
|
||||
from app.clients.performance_platform.performance_platform_client import PerformancePlatformClient
|
||||
|
||||
|
||||
class SQLAlchemy(_SQLAlchemy):
|
||||
@@ -126,36 +136,52 @@ def create_app(application):
|
||||
|
||||
|
||||
def register_blueprint(application):
|
||||
from app.service.rest import service_blueprint
|
||||
from app.service.callback_rest import service_callback_blueprint
|
||||
from app.user.rest import user_blueprint
|
||||
from app.template.rest import template_blueprint
|
||||
from app.status.healthcheck import status as status_blueprint
|
||||
from app.job.rest import job_blueprint
|
||||
from app.notifications.rest import notifications as notifications_blueprint
|
||||
from app.invite.rest import invite as invite_blueprint
|
||||
from app.accept_invite.rest import accept_invite
|
||||
from app.template_statistics.rest import template_statistics as template_statistics_blueprint
|
||||
from app.events.rest import events as events_blueprint
|
||||
from app.provider_details.rest import provider_details as provider_details_blueprint
|
||||
from app.authentication.auth import (
|
||||
requires_admin_auth,
|
||||
requires_auth,
|
||||
requires_no_auth,
|
||||
)
|
||||
from app.billing.rest import billing_blueprint
|
||||
from app.broadcast_message.rest import broadcast_message_blueprint
|
||||
from app.complaint.complaint_rest import complaint_blueprint
|
||||
from app.email_branding.rest import email_branding_blueprint
|
||||
from app.events.rest import events as events_blueprint
|
||||
from app.inbound_number.rest import inbound_number_blueprint
|
||||
from app.inbound_sms.rest import inbound_sms as inbound_sms_blueprint
|
||||
from app.notifications.receive_notifications import receive_notifications_blueprint
|
||||
from app.notifications.notifications_sms_callback import sms_callback_blueprint
|
||||
from app.notifications.notifications_letter_callback import letter_callback_blueprint
|
||||
from app.authentication.auth import requires_admin_auth, requires_auth, requires_no_auth
|
||||
from app.invite.rest import invite as invite_blueprint
|
||||
from app.job.rest import job_blueprint
|
||||
from app.letter_branding.letter_branding_rest import (
|
||||
letter_branding_blueprint,
|
||||
)
|
||||
from app.letters.rest import letter_job
|
||||
from app.billing.rest import billing_blueprint
|
||||
from app.organisation.rest import organisation_blueprint
|
||||
from app.notifications.notifications_letter_callback import (
|
||||
letter_callback_blueprint,
|
||||
)
|
||||
from app.notifications.notifications_sms_callback import (
|
||||
sms_callback_blueprint,
|
||||
)
|
||||
from app.notifications.receive_notifications import (
|
||||
receive_notifications_blueprint,
|
||||
)
|
||||
from app.notifications.rest import notifications as notifications_blueprint
|
||||
from app.organisation.invite_rest import organisation_invite_blueprint
|
||||
from app.complaint.complaint_rest import complaint_blueprint
|
||||
from app.organisation.rest import organisation_blueprint
|
||||
from app.performance_dashboard.rest import performance_dashboard_blueprint
|
||||
from app.platform_stats.rest import platform_stats_blueprint
|
||||
from app.provider_details.rest import (
|
||||
provider_details as provider_details_blueprint,
|
||||
)
|
||||
from app.service.callback_rest import service_callback_blueprint
|
||||
from app.service.rest import service_blueprint
|
||||
from app.status.healthcheck import status as status_blueprint
|
||||
from app.template.rest import template_blueprint
|
||||
from app.template_folder.rest import template_folder_blueprint
|
||||
from app.letter_branding.letter_branding_rest import letter_branding_blueprint
|
||||
from app.template_statistics.rest import (
|
||||
template_statistics as template_statistics_blueprint,
|
||||
)
|
||||
from app.upload.rest import upload_blueprint
|
||||
from app.broadcast_message.rest import broadcast_message_blueprint
|
||||
from app.user.rest import user_blueprint
|
||||
|
||||
service_blueprint.before_request(requires_admin_auth)
|
||||
application.register_blueprint(service_blueprint, url_prefix='/service')
|
||||
@@ -249,14 +275,28 @@ def register_blueprint(application):
|
||||
|
||||
|
||||
def register_v2_blueprints(application):
|
||||
from app.v2.inbound_sms.get_inbound_sms import v2_inbound_sms_blueprint as get_inbound_sms
|
||||
from app.v2.notifications.post_notifications import v2_notification_blueprint as post_notifications
|
||||
from app.v2.notifications.get_notifications import v2_notification_blueprint as get_notifications
|
||||
from app.v2.template.get_template import v2_template_blueprint as get_template
|
||||
from app.v2.templates.get_templates import v2_templates_blueprint as get_templates
|
||||
from app.v2.template.post_template import v2_template_blueprint as post_template
|
||||
from app.v2.broadcast.post_broadcast import v2_broadcast_blueprint as post_broadcast
|
||||
from app.authentication.auth import requires_auth
|
||||
from app.v2.broadcast.post_broadcast import (
|
||||
v2_broadcast_blueprint as post_broadcast,
|
||||
)
|
||||
from app.v2.inbound_sms.get_inbound_sms import (
|
||||
v2_inbound_sms_blueprint as get_inbound_sms,
|
||||
)
|
||||
from app.v2.notifications.get_notifications import (
|
||||
v2_notification_blueprint as get_notifications,
|
||||
)
|
||||
from app.v2.notifications.post_notifications import (
|
||||
v2_notification_blueprint as post_notifications,
|
||||
)
|
||||
from app.v2.template.get_template import (
|
||||
v2_template_blueprint as get_template,
|
||||
)
|
||||
from app.v2.template.post_template import (
|
||||
v2_template_blueprint as post_template,
|
||||
)
|
||||
from app.v2.templates.get_templates import (
|
||||
v2_templates_blueprint as get_templates,
|
||||
)
|
||||
|
||||
post_notifications.before_request(requires_auth)
|
||||
application.register_blueprint(post_notifications)
|
||||
|
||||
Reference in New Issue
Block a user