mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
add warning if DB not ready
This commit is contained in:
parent
84871fdc79
commit
99f3fc814d
@ -2,6 +2,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import logging
|
import logging
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import warnings
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -42,6 +43,13 @@ class LabelConfig(AppConfig):
|
|||||||
"""
|
"""
|
||||||
Create all default templates
|
Create all default templates
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
from .models import StockLocationLabel
|
||||||
|
except AppRegistryNotReady:
|
||||||
|
# Database might not yet be ready
|
||||||
|
warnings.warn('Database was not ready for creating labels')
|
||||||
|
return
|
||||||
|
|
||||||
self.create_stock_item_labels()
|
self.create_stock_item_labels()
|
||||||
self.create_stock_location_labels()
|
self.create_stock_location_labels()
|
||||||
self.create_part_labels()
|
self.create_part_labels()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user