mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 21:15:41 +00:00
Refactor "ready" state into a function
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import logging
|
||||
import hashlib
|
||||
@ -7,6 +6,8 @@ import hashlib
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
|
||||
from InvenTree.ready import canAppAccessDatabase
|
||||
|
||||
|
||||
logger = logging.getLogger("inventree")
|
||||
|
||||
@ -33,14 +34,7 @@ class LabelConfig(AppConfig):
|
||||
This function is called whenever the label app is loaded
|
||||
"""
|
||||
|
||||
if 'loaddata' in sys.argv:
|
||||
"""
|
||||
In the case we are importing records,
|
||||
do not automatically copy labels across.
|
||||
This can cause database conflicts!
|
||||
"""
|
||||
pass
|
||||
else:
|
||||
if canAppAccessDatabase():
|
||||
self.create_stock_item_labels()
|
||||
self.create_stock_location_labels()
|
||||
|
||||
|
Reference in New Issue
Block a user