2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 13:10:57 +00:00

Refactor "ready" state into a function

This commit is contained in:
Oliver Walters
2021-04-25 10:52:31 +10:00
parent 6e5fc43105
commit 06afd4d726
8 changed files with 60 additions and 33 deletions

View File

@ -3,11 +3,14 @@ from __future__ import unicode_literals
import os
import logging
from PIL import UnidentifiedImageError
from django.apps import AppConfig
from django.db.utils import OperationalError, ProgrammingError
from django.conf import settings
from PIL import UnidentifiedImageError
from InvenTree.ready import canAppAccessDatabase
logger = logging.getLogger("inventree")
@ -20,7 +23,8 @@ class CompanyConfig(AppConfig):
This function is called whenever the Company app is loaded.
"""
self.generate_company_thumbs()
if canAppAccessDatabase():
self.generate_company_thumbs()
def generate_company_thumbs(self):