mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Fixing errant isort formatting
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
+1
-1
@@ -12,6 +12,7 @@ from flask.ctx import has_app_context
|
|||||||
from flask_marshmallow import Marshmallow
|
from flask_marshmallow import Marshmallow
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate
|
||||||
from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy
|
||||||
|
from notifications_utils import logging, request_helper
|
||||||
from notifications_utils.clients.encryption.encryption_client import Encryption
|
from notifications_utils.clients.encryption.encryption_client import Encryption
|
||||||
from notifications_utils.clients.redis.redis_client import RedisClient
|
from notifications_utils.clients.redis.redis_client import RedisClient
|
||||||
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
||||||
@@ -25,7 +26,6 @@ from app.clients.document_download import DocumentDownloadClient
|
|||||||
from app.clients.email.aws_ses import AwsSesClient
|
from app.clients.email.aws_ses import AwsSesClient
|
||||||
from app.clients.email.aws_ses_stub import AwsSesStubClient
|
from app.clients.email.aws_ses_stub import AwsSesStubClient
|
||||||
from app.clients.sms.aws_sns import AwsSnsClient
|
from app.clients.sms.aws_sns import AwsSnsClient
|
||||||
from notifications_utils import logging, request_helper
|
|
||||||
|
|
||||||
|
|
||||||
class NotifyCelery(Celery):
|
class NotifyCelery(Celery):
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ from notifications_python_client.errors import (
|
|||||||
TokenExpiredError,
|
TokenExpiredError,
|
||||||
TokenIssuerError,
|
TokenIssuerError,
|
||||||
)
|
)
|
||||||
|
from notifications_utils import request_helper
|
||||||
from sqlalchemy.orm.exc import NoResultFound
|
from sqlalchemy.orm.exc import NoResultFound
|
||||||
|
|
||||||
from app.serialised_models import SerialisedService
|
from app.serialised_models import SerialisedService
|
||||||
from notifications_utils import request_helper
|
|
||||||
|
|
||||||
# stvnrlly - this is silly, but bandit has a multiline string bug (https://github.com/PyCQA/bandit/issues/658)
|
# stvnrlly - this is silly, but bandit has a multiline string bug (https://github.com/PyCQA/bandit/issues/658)
|
||||||
# and flake8 wants a multiline quote here. TODO: check on bug status and restore sanity once possible
|
# and flake8 wants a multiline quote here. TODO: check on bug status and restore sanity once possible
|
||||||
|
|||||||
+1
-1
@@ -2,10 +2,10 @@ import json
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from os import getenv, path
|
from os import getenv, path
|
||||||
|
|
||||||
|
import notifications_utils
|
||||||
from celery.schedules import crontab
|
from celery.schedules import crontab
|
||||||
from kombu import Exchange, Queue
|
from kombu import Exchange, Queue
|
||||||
|
|
||||||
import notifications_utils
|
|
||||||
from app.cloudfoundry_config import cloud_config
|
from app.cloudfoundry_config import cloud_config
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from flask import Blueprint, current_app, jsonify, request
|
from flask import Blueprint, current_app, jsonify, request
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
|
|
||||||
from app import api_user, authenticated_service
|
from app import api_user, authenticated_service
|
||||||
from app.aws.s3 import get_personalisation_from_s3, get_phone_number_from_s3
|
from app.aws.s3 import get_personalisation_from_s3, get_phone_number_from_s3
|
||||||
@@ -25,7 +26,6 @@ from app.schemas import (
|
|||||||
)
|
)
|
||||||
from app.service.utils import service_allowed_to_send_to
|
from app.service.utils import service_allowed_to_send_to
|
||||||
from app.utils import get_public_notify_type_text, pagination_links
|
from app.utils import get_public_notify_type_text, pagination_links
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
|
|
||||||
notifications = Blueprint("notifications", __name__)
|
notifications = Blueprint("notifications", __name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
|
from notifications_utils.clients.redis import (
|
||||||
|
rate_limit_cache_key,
|
||||||
|
total_limit_cache_key,
|
||||||
|
)
|
||||||
from notifications_utils.recipients import (
|
from notifications_utils.recipients import (
|
||||||
get_international_phone_info,
|
get_international_phone_info,
|
||||||
validate_and_format_email_address,
|
validate_and_format_email_address,
|
||||||
@@ -17,11 +22,6 @@ from app.serialised_models import SerialisedTemplate
|
|||||||
from app.service.utils import service_allowed_to_send_to
|
from app.service.utils import service_allowed_to_send_to
|
||||||
from app.utils import get_public_notify_type_text
|
from app.utils import get_public_notify_type_text
|
||||||
from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError
|
from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
from notifications_utils.clients.redis import (
|
|
||||||
rate_limit_cache_key,
|
|
||||||
total_limit_cache_key,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def check_service_over_api_rate_limit(service, api_key):
|
def check_service_over_api_rate_limit(service, api_key):
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from threading import RLock
|
|||||||
|
|
||||||
import cachetools
|
import cachetools
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
from notifications_utils.clients.redis import RequestCache
|
||||||
from notifications_utils.serialised_model import (
|
from notifications_utils.serialised_model import (
|
||||||
SerialisedModel,
|
SerialisedModel,
|
||||||
SerialisedModelCollection,
|
SerialisedModelCollection,
|
||||||
@@ -13,7 +14,6 @@ from werkzeug.utils import cached_property
|
|||||||
from app import db, redis_store
|
from app import db, redis_store
|
||||||
from app.dao.api_key_dao import get_model_api_keys
|
from app.dao.api_key_dao import get_model_api_keys
|
||||||
from app.dao.services_dao import dao_fetch_service_by_id
|
from app.dao.services_dao import dao_fetch_service_by_id
|
||||||
from notifications_utils.clients.redis import RequestCache
|
|
||||||
|
|
||||||
caches = defaultdict(partial(cachetools.TTLCache, maxsize=1024, ttl=2))
|
caches = defaultdict(partial(cachetools.TTLCache, maxsize=1024, ttl=2))
|
||||||
locks = defaultdict(RLock)
|
locks = defaultdict(RLock)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from flask import Blueprint, jsonify, request
|
from flask import Blueprint, jsonify, request
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
from notifications_utils.template import SMSMessageTemplate
|
from notifications_utils.template import SMSMessageTemplate
|
||||||
from sqlalchemy.orm.exc import NoResultFound
|
from sqlalchemy.orm.exc import NoResultFound
|
||||||
|
|
||||||
@@ -27,7 +28,6 @@ from app.template.template_schemas import (
|
|||||||
post_update_template_schema,
|
post_update_template_schema,
|
||||||
)
|
)
|
||||||
from app.utils import get_public_notify_type_text
|
from app.utils import get_public_notify_type_text
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
|
|
||||||
template_blueprint = Blueprint(
|
template_blueprint = Blueprint(
|
||||||
"template", __name__, url_prefix="/service/<uuid:service_id>/template"
|
"template", __name__, url_prefix="/service/<uuid:service_id>/template"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
|
|
||||||
import app
|
import app
|
||||||
from app.dao import templates_dao
|
from app.dao import templates_dao
|
||||||
@@ -36,7 +37,6 @@ from app.serialised_models import (
|
|||||||
from app.service.utils import service_allowed_to_send_to
|
from app.service.utils import service_allowed_to_send_to
|
||||||
from app.utils import get_template_instance
|
from app.utils import get_template_instance
|
||||||
from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError
|
from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
from tests.app.db import (
|
from tests.app.db import (
|
||||||
create_api_key,
|
create_api_key,
|
||||||
create_reply_to_email,
|
create_reply_to_email,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import pytest
|
|||||||
from flask import current_app, json
|
from flask import current_app, json
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
from notifications_python_client.authentication import create_jwt_token
|
from notifications_python_client.authentication import create_jwt_token
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
|
|
||||||
import app
|
import app
|
||||||
from app.dao import notifications_dao
|
from app.dao import notifications_dao
|
||||||
@@ -16,7 +17,6 @@ from app.errors import InvalidRequest
|
|||||||
from app.models import ApiKey, Notification, NotificationHistory, Template
|
from app.models import ApiKey, Notification, NotificationHistory, Template
|
||||||
from app.service.send_notification import send_one_off_notification
|
from app.service.send_notification import send_one_off_notification
|
||||||
from app.v2.errors import RateLimitError
|
from app.v2.errors import RateLimitError
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
from tests import create_service_authorization_header
|
from tests import create_service_authorization_header
|
||||||
from tests.app.db import (
|
from tests.app.db import (
|
||||||
create_api_key,
|
create_api_key,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import uuid
|
|||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
from notifications_utils.recipients import InvalidPhoneError
|
from notifications_utils.recipients import InvalidPhoneError
|
||||||
|
|
||||||
from app.config import QueueNames
|
from app.config import QueueNames
|
||||||
@@ -17,7 +18,6 @@ from app.enums import (
|
|||||||
from app.models import Notification, ServiceGuestList
|
from app.models import Notification, ServiceGuestList
|
||||||
from app.service.send_notification import send_one_off_notification
|
from app.service.send_notification import send_one_off_notification
|
||||||
from app.v2.errors import BadRequestError
|
from app.v2.errors import BadRequestError
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
from tests.app.db import (
|
from tests.app.db import (
|
||||||
create_reply_to_email,
|
create_reply_to_email,
|
||||||
create_service,
|
create_service,
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ from datetime import datetime, timedelta
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
|
|
||||||
from app.dao.templates_dao import dao_get_template_by_id, dao_redact_template
|
from app.dao.templates_dao import dao_get_template_by_id, dao_redact_template
|
||||||
from app.enums import ServicePermissionType, TemplateProcessType, TemplateType
|
from app.enums import ServicePermissionType, TemplateProcessType, TemplateType
|
||||||
from app.models import Template, TemplateHistory
|
from app.models import Template, TemplateHistory
|
||||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
|
||||||
from tests import create_admin_authorization_header
|
from tests import create_admin_authorization_header
|
||||||
from tests.app.db import create_service, create_template, create_template_folder
|
from tests.app.db import create_service, create_template, create_template_folder
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user