fix: lazy-import write_notification to prevent partial module load in tests

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andjokob-sk authored and GitHub committed 2026-08-20 22:09:27 +00:00
1 parent baed8d458f
commit 05bdf1985e
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -12,4 +12,7 @@ README.md
CONTRIBUTING
FUNDING.yml
config/.gitignore
db/.gitignore
db/.gitignore
**/__pycache__
**/*.pyc
**/*.pyo
+1 -1
View File
@@ -18,7 +18,6 @@ from helper import (
get_setting_value,
getBuildTimeStampAndVersion,
)
from messaging.in_app import write_notification
from messaging.notification_sections import SECTION_ORDER
from utils.datetime_utils import timeNowUTC, timeNowTZ, get_timezone_offset
@@ -162,6 +161,7 @@ class NotificationInstance:
self.HTML = final_html
# Notify frontend
from messaging.in_app import write_notification # lazy import to avoid Flask dep at module level
write_notification(f"Report:{self.GUID}", "alert", self.DateTimeCreated)
self.upsert()