mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Minor changes accounting for black and isort formatting
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -12,7 +12,6 @@ from flask.ctx import has_app_context
|
||||
from flask_marshmallow import Marshmallow
|
||||
from flask_migrate import Migrate
|
||||
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.redis.redis_client import RedisClient
|
||||
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
||||
@@ -26,6 +25,7 @@ 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.sms.aws_sns import AwsSnsClient
|
||||
from notifications_utils import logging, request_helper
|
||||
|
||||
|
||||
class NotifyCelery(Celery):
|
||||
|
||||
@@ -12,10 +12,10 @@ from notifications_python_client.errors import (
|
||||
TokenExpiredError,
|
||||
TokenIssuerError,
|
||||
)
|
||||
from notifications_utils import request_helper
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
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)
|
||||
# and flake8 wants a multiline quote here. TODO: check on bug status and restore sanity once possible
|
||||
|
||||
@@ -2,10 +2,10 @@ import json
|
||||
from datetime import timedelta
|
||||
from os import getenv, path
|
||||
|
||||
import notifications_utils
|
||||
from celery.schedules import crontab
|
||||
from kombu import Exchange, Queue
|
||||
|
||||
import notifications_utils
|
||||
from app.cloudfoundry_config import cloud_config
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
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.aws.s3 import get_personalisation_from_s3, get_phone_number_from_s3
|
||||
@@ -26,6 +25,7 @@ from app.schemas import (
|
||||
)
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.utils import get_public_notify_type_text, pagination_links
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
|
||||
notifications = Blueprint("notifications", __name__)
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
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 (
|
||||
get_international_phone_info,
|
||||
validate_and_format_email_address,
|
||||
@@ -22,6 +17,11 @@ from app.serialised_models import SerialisedTemplate
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.utils import get_public_notify_type_text
|
||||
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):
|
||||
|
||||
@@ -4,7 +4,6 @@ from threading import RLock
|
||||
|
||||
import cachetools
|
||||
from flask import current_app
|
||||
from notifications_utils.clients.redis import RequestCache
|
||||
from notifications_utils.serialised_model import (
|
||||
SerialisedModel,
|
||||
SerialisedModelCollection,
|
||||
@@ -14,6 +13,7 @@ from werkzeug.utils import cached_property
|
||||
from app import db, redis_store
|
||||
from app.dao.api_key_dao import get_model_api_keys
|
||||
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))
|
||||
locks = defaultdict(RLock)
|
||||
|
||||
@@ -55,7 +55,7 @@ def _create_service_invite(invited_user, invite_link_host):
|
||||
data = {}
|
||||
permissions = invited_user.permissions
|
||||
permissions = permissions.split(",")
|
||||
data["from_user_id"] = (str(invited_user.from_user.id))
|
||||
data["from_user_id"] = str(invited_user.from_user.id)
|
||||
data["service_id"] = str(invited_user.service.id)
|
||||
data["permissions"] = permissions
|
||||
data["folder_permissions"] = invited_user.folder_permissions
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from flask import Blueprint, jsonify, request
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
from notifications_utils.template import SMSMessageTemplate
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
@@ -28,6 +27,7 @@ from app.template.template_schemas import (
|
||||
post_update_template_schema,
|
||||
)
|
||||
from app.utils import get_public_notify_type_text
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
|
||||
template_blueprint = Blueprint(
|
||||
"template", __name__, url_prefix="/service/<uuid:service_id>/template"
|
||||
|
||||
Reference in New Issue
Block a user