mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Fix flake8 and isort errors
Note, isort now has default behaviour of searching recursively so we no longer need the `-rc` flag
This commit is contained in:
@@ -500,11 +500,9 @@ def setup_blueprints(application):
|
||||
updated, including the expiration date. If you have a dashboard open and in focus it'll refresh the expiration timer
|
||||
every two seconds, and you will never log out, which is behaviour we want to preserve.
|
||||
"""
|
||||
from app.main import main as main_blueprint
|
||||
from app.main import no_cookie as no_cookie_blueprint
|
||||
from app.status import status as status_blueprint
|
||||
from app.main import (
|
||||
main as main_blueprint,
|
||||
no_cookie as no_cookie_blueprint
|
||||
)
|
||||
|
||||
main_blueprint.before_request(make_session_permanent)
|
||||
main_blueprint.after_request(save_service_or_org_after_request)
|
||||
@@ -517,6 +515,7 @@ def setup_blueprints(application):
|
||||
|
||||
def setup_event_handlers():
|
||||
from flask_login import user_logged_in
|
||||
|
||||
from app.event_handlers import on_user_logged_in
|
||||
|
||||
user_logged_in.connect(on_user_logged_in)
|
||||
|
||||
@@ -7,7 +7,6 @@ from pathlib import Path
|
||||
import geojson
|
||||
from notifications_utils.formatters import formatted_list
|
||||
from notifications_utils.polygons import Polygons
|
||||
|
||||
from populations import (
|
||||
BRYHER,
|
||||
CITY_OF_LONDON,
|
||||
@@ -68,7 +67,7 @@ def estimate_number_of_smartphones_in_area(country_or_ward_code):
|
||||
# We don’t have population figures for wards of the City of
|
||||
# London. We’ll leave it empty here and estimate on the fly
|
||||
# later based on physical area.
|
||||
print(f' Population: N/A') # noqa: T001
|
||||
print(' Population: N/A') # noqa: T001
|
||||
return None
|
||||
|
||||
# For some reason Bryher is the only ward missing population data, so we
|
||||
|
||||
@@ -1354,14 +1354,14 @@ class LetterAddressForm(StripWhitespaceForm):
|
||||
if not address.has_valid_last_line:
|
||||
if self.allow_international_letters:
|
||||
raise ValidationError(
|
||||
f'Last line of the address must be a UK postcode or another country'
|
||||
'Last line of the address must be a UK postcode or another country'
|
||||
)
|
||||
if address.international:
|
||||
raise ValidationError(
|
||||
f'You do not have permission to send letters to other countries'
|
||||
'You do not have permission to send letters to other countries'
|
||||
)
|
||||
raise ValidationError(
|
||||
f'Last line of the address must be a real UK postcode'
|
||||
'Last line of the address must be a real UK postcode'
|
||||
)
|
||||
|
||||
if address.has_invalid_characters:
|
||||
|
||||
@@ -91,7 +91,7 @@ def revalidate_email_sent():
|
||||
|
||||
# see http://flask.pocoo.org/snippets/62/
|
||||
def _is_safe_redirect_url(target):
|
||||
from urllib.parse import urlparse, urljoin
|
||||
from urllib.parse import urljoin, urlparse
|
||||
host_url = urlparse(request.host_url)
|
||||
redirect_url = urlparse(urljoin(request.host_url, target))
|
||||
return redirect_url.scheme in ('http', 'https') and \
|
||||
|
||||
@@ -78,9 +78,7 @@ class OrganisationsClient(NotifyAdminAPIClient):
|
||||
return self.get(url="/organisations/{}/services".format(org_id))
|
||||
|
||||
def remove_user_from_organisation(self, org_id, user_id):
|
||||
endpoint = '/organisations/{}/users/{}'.format(
|
||||
org_id=org_id,
|
||||
user_id=user_id)
|
||||
endpoint = '/organisations/{}/users/{}'.format(org_id, user_id)
|
||||
data = _attach_current_user({})
|
||||
return self.delete(endpoint, data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user