mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 00:06:16 -04:00
broadcast flake8 cleanup
This commit is contained in:
@@ -63,6 +63,7 @@ class InternalApiKey():
|
|||||||
def requires_no_auth():
|
def requires_no_auth():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def requires_admin_auth():
|
def requires_admin_auth():
|
||||||
requires_internal_auth(current_app.config.get('ADMIN_CLIENT_ID'))
|
requires_internal_auth(current_app.config.get('ADMIN_CLIENT_ID'))
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from notifications_utils.clients.zendesk.zendesk_client import (
|
|||||||
from sqlalchemy import between
|
from sqlalchemy import between
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
from sqlalchemy.exc import SQLAlchemyError
|
||||||
|
|
||||||
from app import db, notify_celery, zendesk_client
|
from app import notify_celery, zendesk_client
|
||||||
from app.aws import s3
|
from app.aws import s3
|
||||||
from app.celery.letters_pdf_tasks import get_pdf_for_templated_letter
|
from app.celery.letters_pdf_tasks import get_pdf_for_templated_letter
|
||||||
from app.celery.tasks import (
|
from app.celery.tasks import (
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ from sqlalchemy.ext.associationproxy import association_proxy
|
|||||||
from sqlalchemy.ext.declarative import declared_attr
|
from sqlalchemy.ext.declarative import declared_attr
|
||||||
from sqlalchemy.ext.hybrid import hybrid_property
|
from sqlalchemy.ext.hybrid import hybrid_property
|
||||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||||
from sqlalchemy.schema import Sequence
|
|
||||||
|
|
||||||
from app import db, encryption
|
from app import db, encryption
|
||||||
from app.hashing import check_hash, hashpw
|
from app.hashing import check_hash, hashpw
|
||||||
@@ -43,7 +42,6 @@ from app.utils import (
|
|||||||
DATETIME_FORMAT,
|
DATETIME_FORMAT,
|
||||||
DATETIME_FORMAT_NO_TIMEZONE,
|
DATETIME_FORMAT_NO_TIMEZONE,
|
||||||
get_dt_string_or_none,
|
get_dt_string_or_none,
|
||||||
get_uuid_string_or_none,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SMS_TYPE = 'sms'
|
SMS_TYPE = 'sms'
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class ServiceSchema(BaseSchema, UUIDsAsStringsMixin):
|
|||||||
email_branding = field_for(models.Service, 'email_branding')
|
email_branding = field_for(models.Service, 'email_branding')
|
||||||
organisation = field_for(models.Service, 'organisation')
|
organisation = field_for(models.Service, 'organisation')
|
||||||
go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE)
|
go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE)
|
||||||
|
|
||||||
def get_letter_logo_filename(self, service):
|
def get_letter_logo_filename(self, service):
|
||||||
return service.letter_branding and service.letter_branding.filename
|
return service.letter_branding and service.letter_branding.filename
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def get_public_notify_type_text(notify_type, plural=False):
|
|||||||
notify_type_text = 'document'
|
notify_type_text = 'document'
|
||||||
elif notify_type == PRECOMPILED_LETTER:
|
elif notify_type == PRECOMPILED_LETTER:
|
||||||
notify_type_text = 'precompiled letter'
|
notify_type_text = 'precompiled letter'
|
||||||
|
|
||||||
return '{}{}'.format(notify_type_text, 's' if plural else '')
|
return '{}{}'.format(notify_type_text, 's' if plural else '')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import uuid
|
|||||||
|
|
||||||
import jwt
|
import jwt
|
||||||
import pytest
|
import pytest
|
||||||
from flask import current_app, g, request
|
from flask import g, request
|
||||||
from notifications_python_client.authentication import create_jwt_token
|
from notifications_python_client.authentication import create_jwt_token
|
||||||
|
|
||||||
from app import db
|
from app import db
|
||||||
@@ -24,7 +24,6 @@ from app.dao.api_key_dao import (
|
|||||||
from app.dao.services_dao import dao_fetch_service_by_id
|
from app.dao.services_dao import dao_fetch_service_by_id
|
||||||
from tests import (
|
from tests import (
|
||||||
create_admin_authorization_header,
|
create_admin_authorization_header,
|
||||||
create_internal_authorization_header,
|
|
||||||
create_service_authorization_header,
|
create_service_authorization_header,
|
||||||
)
|
)
|
||||||
from tests.conftest import set_config_values
|
from tests.conftest import set_config_values
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ from app.models import (
|
|||||||
)
|
)
|
||||||
from tests.app import load_example_csv
|
from tests.app import load_example_csv
|
||||||
from tests.app.db import create_job, create_notification, create_template
|
from tests.app.db import create_job, create_notification, create_template
|
||||||
from tests.conftest import set_config
|
|
||||||
|
|
||||||
|
|
||||||
def _create_slow_delivery_notification(template, provider='mmg'):
|
def _create_slow_delivery_notification(template, provider='mmg'):
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import random
|
|||||||
import uuid
|
import uuid
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from app import db
|
from app import db
|
||||||
from app.dao import fact_processing_time_dao
|
from app.dao import fact_processing_time_dao
|
||||||
from app.dao.email_branding_dao import dao_create_email_branding
|
from app.dao.email_branding_dao import dao_create_email_branding
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ from app.models import (
|
|||||||
KEY_TYPE_TEST,
|
KEY_TYPE_TEST,
|
||||||
LETTER_TYPE,
|
LETTER_TYPE,
|
||||||
NOTIFICATION_RETURNED_LETTER,
|
NOTIFICATION_RETURNED_LETTER,
|
||||||
SERVICE_PERMISSION_TYPES,
|
|
||||||
SMS_TYPE,
|
SMS_TYPE,
|
||||||
UPLOAD_LETTERS,
|
UPLOAD_LETTERS,
|
||||||
AnnualBilling,
|
AnnualBilling,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import pytest
|
|||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
from alembic.command import upgrade
|
from alembic.command import upgrade
|
||||||
from alembic.config import Config
|
from alembic.config import Config
|
||||||
from flask import Flask, current_app
|
from flask import Flask
|
||||||
|
|
||||||
from app import create_app, db
|
from app import create_app, db
|
||||||
from app.dao.provider_details_dao import get_provider_details_by_identifier
|
from app.dao.provider_details_dao import get_provider_details_by_identifier
|
||||||
|
|||||||
Reference in New Issue
Block a user