mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
move (non-api) clients (inc redis) from app/__init__.py to extensions
when clients are defined in app/__init__.py, it increases the chance of cyclical imports. By moving module level client singletons out to a separate extensions file, we stop cyclical imports, but keep the same code flow - the clients are still initialised in `create_app` in `__init__.py`. The redis client in particular is no longer separate - previously redis was set up on the `NotifyAdminAPIClient` base class, but now there's one singleton in `app.extensions`. This was done so that we can access redis from outside of the existing clients.
This commit is contained in:
@@ -4,12 +4,8 @@ import pytz
|
||||
from flask import abort, redirect, render_template, request, session, url_for
|
||||
from flask_login import current_user
|
||||
|
||||
from app import (
|
||||
convert_to_boolean,
|
||||
current_service,
|
||||
service_api_client,
|
||||
zendesk_client,
|
||||
)
|
||||
from app import convert_to_boolean, current_service, service_api_client
|
||||
from app.extensions import zendesk_client
|
||||
from app.main import main
|
||||
from app.main.forms import Feedback, Problem, SupportType, Triage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user