2
0
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:
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

@ -9,6 +9,9 @@ from django.conf import settings
from PIL import UnidentifiedImageError
from InvenTree.ready import canAppAccessDatabase
logger = logging.getLogger("inventree")
@ -20,8 +23,9 @@ class PartConfig(AppConfig):
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
self.update_trackable_status()
if canAppAccessDatabase():
self.generate_part_thumbnails()
self.update_trackable_status()
def generate_part_thumbnails(self):
"""