mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Move inline import to top of file
Usually we have imports at the top. It looks like the reason for them being inline was to avoid a circular import, but we can also avoid this by not importing everything from the app module. Since we're about to add more imports from event_handlers, now is a good time to refactor them. Note this matches how we import the event handlers in every other module.
This commit is contained in:
@@ -4,6 +4,7 @@ from notifications_python_client.errors import HTTPError
|
||||
from notifications_utils.timezones import utc_string_to_aware_gmt_datetime
|
||||
from werkzeug.utils import cached_property
|
||||
|
||||
from app.event_handlers import create_add_user_to_service_event
|
||||
from app.models import JSONModel, ModelList
|
||||
from app.models.organisation import Organisation
|
||||
from app.models.roles_and_permissions import (
|
||||
@@ -401,8 +402,6 @@ class User(JSONModel, UserMixin):
|
||||
session['current_session_id'] = self.current_session_id
|
||||
|
||||
def add_to_service(self, service_id, permissions, folder_permissions, invited_by_id):
|
||||
from app.event_handlers import create_add_user_to_service_event
|
||||
|
||||
try:
|
||||
user_api_client.add_user_to_service(
|
||||
service_id,
|
||||
|
||||
Reference in New Issue
Block a user