mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-09 13:20:53 +00:00
Skips some specific steps when importing data
- We need to prevent certain operations from running when we are importing data - This is to prevent unique database constraints from being violated - Do not register plugins during data import - Do not launch notification events
This commit is contained in:
@@ -13,6 +13,7 @@ from common.models import NotificationEntry
|
||||
|
||||
import InvenTree.helpers
|
||||
import InvenTree.tasks
|
||||
from InvenTree.ready import isImportingData
|
||||
|
||||
import part.models
|
||||
|
||||
@@ -24,6 +25,10 @@ def notify_low_stock(part: part.models.Part):
|
||||
Notify users who have starred a part when its stock quantity falls below the minimum threshold
|
||||
"""
|
||||
|
||||
# Do not notify if we are importing data
|
||||
if isImportingData():
|
||||
return
|
||||
|
||||
# Check if we have notified recently...
|
||||
delta = timedelta(days=1)
|
||||
|
||||
|
Reference in New Issue
Block a user