This commit is contained in:
parent
0e4781a7a5
commit
e3dd6f2a68
@ -84,6 +84,9 @@ def context_processor():
|
||||
|
||||
settings = Settings.query.first()
|
||||
if settings.background == "random":
|
||||
if len(os.listdir(backgrounds_images_folder)) < 1:
|
||||
settings.background = None
|
||||
else:
|
||||
settings.background = (
|
||||
f"static/images/backgrounds/"
|
||||
f"{random.choice(os.listdir(backgrounds_images_folder))}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user