2
0
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:
Oliver
2022-02-03 16:03:46 +11:00
parent eef15b13ec
commit 78b1c7a22b
4 changed files with 33 additions and 11 deletions

View File

@@ -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)