mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Return early if themes dir does not exist (#3452)
This commit is contained in:
parent
ef12a834e0
commit
a5123479a6
@ -1775,12 +1775,13 @@ class ColorTheme(models.Model):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_color_themes_choices(cls):
|
def get_color_themes_choices(cls):
|
||||||
"""Get all color themes from static folder."""
|
"""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')
|
logger.error('Theme directory does not exsist')
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# Get files list from css/color-themes/ folder
|
# Get files list from css/color-themes/ folder
|
||||||
files_list = []
|
files_list = []
|
||||||
|
|
||||||
for file in os.listdir(settings.STATIC_COLOR_THEMES_DIR):
|
for file in os.listdir(settings.STATIC_COLOR_THEMES_DIR):
|
||||||
files_list.append(os.path.splitext(file))
|
files_list.append(os.path.splitext(file))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user