mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 12:05: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:
@ -12,6 +12,8 @@ from allauth.account.models import EmailAddress
|
||||
import build.models
|
||||
import InvenTree.helpers
|
||||
import InvenTree.tasks
|
||||
from InvenTree.ready import isImportingData
|
||||
|
||||
import part.models as part_models
|
||||
|
||||
|
||||
@ -24,6 +26,10 @@ def check_build_stock(build: build.models.Build):
|
||||
and send an email out to any subscribed users if stock is low.
|
||||
"""
|
||||
|
||||
# Do not notify if we are importing data
|
||||
if isImportingData():
|
||||
return
|
||||
|
||||
# Iterate through each of the parts required for this build
|
||||
|
||||
lines = []
|
||||
|
Reference in New Issue
Block a user