From 29f67dc2f3f24dbaf1716728b0da8350268aedfb Mon Sep 17 00:00:00 2001 From: Vadim Stepanov Date: Thu, 19 Jan 2023 11:53:05 +0000 Subject: [PATCH] Fix circular import --- engine/apps/mobile_app/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/apps/mobile_app/tasks.py b/engine/apps/mobile_app/tasks.py index 4d9a098b..521c2903 100644 --- a/engine/apps/mobile_app/tasks.py +++ b/engine/apps/mobile_app/tasks.py @@ -12,7 +12,6 @@ from rest_framework import status from apps.alerts.models import AlertGroup from apps.base.utils import live_settings from apps.mobile_app.alert_rendering import get_push_notification_message -from apps.oss_installation.models import CloudConnector from apps.user_management.models import User from common.api_helpers.utils import create_engine_url from common.custom_celery_tasks import shared_dedicated_queue_retry_task @@ -127,6 +126,8 @@ def notify_user_async(user_pk, alert_group_pk, notification_policy_pk, critical) if settings.LICENSE == settings.OPEN_SOURCE_LICENSE_NAME: # FCM relay uses cloud connection to send push notifications + from apps.oss_installation.models import CloudConnector + if not CloudConnector.objects.exists(): _create_error_log_record() logger.error(f"Error while sending a mobile push notification: not connected to cloud")