diff --git a/children/notifications.py b/children/notifications.py index b081fe4c..d436cb03 100644 --- a/children/notifications.py +++ b/children/notifications.py @@ -1,7 +1,7 @@ from django.utils.translation import gettext_lazy as _ - from django_ilmoitin.dummy_context import dummy_context from django_ilmoitin.registry import notifications + from projects.factories import ProjectFactory from users.factories import GuardianFactory diff --git a/children/schema.py b/children/schema.py index 6f2fd18d..3b32a7a3 100644 --- a/children/schema.py +++ b/children/schema.py @@ -10,6 +10,7 @@ from django.db.models import F, Q from django.utils import timezone as django_utils_timezone from django.utils.timezone import localdate, make_aware +from django_ilmoitin.utils import send_notification from graphene import relay from graphene_django import DjangoConnectionField from graphene_django.types import DjangoObjectType @@ -21,7 +22,6 @@ set_obj_languages_spoken_at_home, ) from common.utils import login_required, map_enums_to_values_in_kwargs, update_object -from django_ilmoitin.utils import send_notification from events.models import Event, EventGroup, EventQueryset, Occurrence from hel_django_auditlog_extra.graphene_decorators import auditlog_access from kukkuu.exceptions import ( diff --git a/common/tests/utils.py b/common/tests/utils.py index 7708a338..58ab5807 100644 --- a/common/tests/utils.py +++ b/common/tests/utils.py @@ -1,8 +1,8 @@ from django.core import mail +from django_ilmoitin.models import NotificationTemplate from parler.utils.context import switch_language from requests.exceptions import HTTPError -from django_ilmoitin.models import NotificationTemplate from kukkuu.consts import GENERAL_ERROR, PERMISSION_DENIED_ERROR diff --git a/events/notifications.py b/events/notifications.py index 6cb23a75..7cd39e6b 100644 --- a/events/notifications.py +++ b/events/notifications.py @@ -2,11 +2,11 @@ from django.utils import timezone from django.utils.translation import gettext_lazy as _ +from django_ilmoitin.dummy_context import dummy_context +from django_ilmoitin.registry import notifications from children.factories import ChildWithGuardianFactory from common.utils import get_global_id -from django_ilmoitin.dummy_context import dummy_context -from django_ilmoitin.registry import notifications from events.consts import NotificationType from events.factories import ( EnrolmentFactory, diff --git a/events/utils.py b/events/utils.py index 923d1d43..4cc3726f 100644 --- a/events/utils.py +++ b/events/utils.py @@ -6,10 +6,10 @@ from django.conf import settings from django.db.models import QuerySet from django.utils import timezone +from django_ilmoitin.utils import send_notification from parler.utils.context import switch_language from common.utils import get_global_id -from django_ilmoitin.utils import send_notification from users.utils import get_communication_unsubscribe_ui_url if TYPE_CHECKING: diff --git a/importers/admin.py b/importers/admin.py index 1048dabd..02b9950c 100644 --- a/importers/admin.py +++ b/importers/admin.py @@ -6,7 +6,6 @@ from django.urls import path, reverse from django.utils.translation import gettext_lazy as _ from django.utils.translation import ngettext_lazy - from django_ilmoitin.admin import NotificationTemplateAdmin from django_ilmoitin.models import NotificationTemplate diff --git a/importers/notification_importer.py b/importers/notification_importer.py index 8735cd83..f8cbd838 100644 --- a/importers/notification_importer.py +++ b/importers/notification_importer.py @@ -8,12 +8,11 @@ from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db import transaction -from parler.utils.context import switch_language -from requests import RequestException - from django_ilmoitin.dummy_context import dummy_context from django_ilmoitin.models import NotificationTemplate, NotificationTemplateException from django_ilmoitin.utils import render_notification_template +from parler.utils.context import switch_language +from requests import RequestException # { # "": { diff --git a/importers/tests/test_notification_importer.py b/importers/tests/test_notification_importer.py index a9d9b81c..9d9af492 100644 --- a/importers/tests/test_notification_importer.py +++ b/importers/tests/test_notification_importer.py @@ -1,9 +1,9 @@ import pytest import responses from django.conf import settings +from django_ilmoitin.models import NotificationTemplate from common.tests.utils import create_notification_template_in_language -from django_ilmoitin.models import NotificationTemplate from events.notifications import NotificationType from ..notification_importer import NotificationImporter diff --git a/messaging/service.py b/messaging/service.py index 13fa0c6e..656eb018 100644 --- a/messaging/service.py +++ b/messaging/service.py @@ -2,10 +2,10 @@ from django.conf import settings from django.utils import timezone -from parler.utils.context import switch_language - from django_ilmoitin.utils import Message as MailerMessage from django_ilmoitin.utils import send_all, send_mail +from parler.utils.context import switch_language + from kukkuu.notification_service import send_sms_notification from messaging.exceptions import AlreadySentError from users.models import Guardian diff --git a/subscriptions/notifications.py b/subscriptions/notifications.py index d4a9cb57..a74df634 100644 --- a/subscriptions/notifications.py +++ b/subscriptions/notifications.py @@ -2,10 +2,10 @@ from django.utils import timezone from django.utils.translation import gettext_lazy as _ - -from children.factories import ChildWithGuardianFactory from django_ilmoitin.dummy_context import dummy_context from django_ilmoitin.registry import notifications + +from children.factories import ChildWithGuardianFactory from events.factories import EventFactory, OccurrenceFactory from events.utils import ( get_event_ui_url, diff --git a/users/admin.py b/users/admin.py index e7fa67c4..ec39cc2e 100644 --- a/users/admin.py +++ b/users/admin.py @@ -11,11 +11,11 @@ from django.http import HttpResponse from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ +from django_ilmoitin.models import NotificationTemplate +from django_ilmoitin.utils import render_notification_template from guardian.admin import GuardedModelAdmin from children.models import Relationship -from django_ilmoitin.models import NotificationTemplate -from django_ilmoitin.utils import render_notification_template from hel_django_auditlog_extra.mixins import AuditlogAdminViewAccessLogMixin from languages.models import Language from projects.models import Project diff --git a/users/notifications.py b/users/notifications.py index 9325dda3..22bc6b1a 100644 --- a/users/notifications.py +++ b/users/notifications.py @@ -1,7 +1,6 @@ from datetime import date from django.utils.translation import gettext_lazy as _ - from django_ilmoitin.dummy_context import dummy_context from django_ilmoitin.registry import notifications diff --git a/users/services.py b/users/services.py index ec54cc6a..6231ec9a 100644 --- a/users/services.py +++ b/users/services.py @@ -4,8 +4,8 @@ from django.core.paginator import Paginator from django.db.models import QuerySet from django.template import Context, Template - from django_ilmoitin.utils import send_notification + from users.models import Guardian from users.utils import get_communication_unsubscribe_ui_url