Prevent notify_users if importing or migrating (#6415)

* Prevent notify_users if importing or migrating

* Comment out format line
This commit is contained in:
Oliver authored and GitHub committed 2024-02-05 13:53:55 +00:00
1 parent 4869d0dab8
commit 676bb02f6e
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -299,6 +299,11 @@ def notify_responsible(
content (NotificationBody, optional): _description_. Defaults to InvenTreeNotificationBodies.NewOrder.
exclude (User, optional): User instance that should be excluded. Defaults to None.
"""
import InvenTree.ready
if InvenTree.ready.isImportingData() or InvenTree.ready.isRunningMigrations():
return
notify_users(
[instance.responsible], instance, sender, content=content, exclude=exclude
)