2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Return early if themes dir does not exist (#3453)

* Return early if themes dir does not exist

(cherry picked from commit 3e1cdcdb079fd2614d4a6478dc0addea94537d6f)

* Bump version number to 0.8.1
This commit is contained in:
Oliver 2022-08-02 10:38:36 +10:00 committed by GitHub
parent 6118d1319c
commit 63664714ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import common.models
from InvenTree.api_version import INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = "0.8.0"
INVENTREE_SW_VERSION = "0.8.1"
def inventreeInstanceName():

View File

@ -1775,12 +1775,13 @@ class ColorTheme(models.Model):
@classmethod
def get_color_themes_choices(cls):
"""Get all color themes from static folder."""
if settings.TESTING and not os.path.exists(settings.STATIC_COLOR_THEMES_DIR):
if not os.path.exists(settings.STATIC_COLOR_THEMES_DIR):
logger.error('Theme directory does not exsist')
return []
# Get files list from css/color-themes/ folder
files_list = []
for file in os.listdir(settings.STATIC_COLOR_THEMES_DIR):
files_list.append(os.path.splitext(file))