if gallery path doesn't exists, show empty gallery

This commit is contained in:
2022-03-06 12:42:59 +00:00
committed by Patrick Mayr
parent 34abb3acf3
commit bcffe6a683
2 changed files with 19 additions and 14 deletions

View File

@@ -47,7 +47,10 @@ def get_image_list(folder_name):
def get_folder_list():
return next(os.walk(settings.MEDIA_ROOT + "/" + gallery_path))[1]
if os.path.exists(settings.MEDIA_ROOT + "/" + gallery_path):
return next(os.walk(settings.MEDIA_ROOT + "/" + gallery_path))[1]
return None
def create_thumbs(folder_path):