mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-10-28 03:51:08 -04:00
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:
1 parent
baed8d458f
commit
05bdf1985e
2 files changed
+5
-2
No files matched your search
+4
-1
@@ -12,4 +12,7 @@ README.md
|
||||
CONTRIBUTING
|
||||
FUNDING.yml
|
||||
config/.gitignore
|
||||
db/.gitignore
|
||||
db/.gitignore
|
||||
**/__pycache__
|
||||
**/*.pyc
|
||||
**/*.pyo
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user