mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-29 20:30:39 +00:00 
			
		
		
		
	add warning if DB not ready
This commit is contained in:
		| @@ -2,6 +2,7 @@ import os | ||||
| import shutil | ||||
| import logging | ||||
| import hashlib | ||||
| import warnings | ||||
|  | ||||
| from django.apps import AppConfig | ||||
| from django.conf import settings | ||||
| @@ -42,6 +43,13 @@ class LabelConfig(AppConfig): | ||||
|         """ | ||||
|         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_location_labels() | ||||
|         self.create_part_labels() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user