improve image handling

This commit is contained in:
Jakob Ketterl 2021-02-09 00:38:59 +01:00
parent 3b670016be
commit 7aa0f8b35d

View File

@ -365,8 +365,7 @@ class GeneralSettingsController(AdminController):
return variables return variables
def handle_image(self, data, image_id): def handle_image(self, data, image_id):
if image_id not in data or not data[image_id]: if image_id in data and data[image_id]:
return
config = CoreConfig() config = CoreConfig()
filename = "{}-{}".format(image_id, data[image_id]) filename = "{}-{}".format(image_id, data[image_id])
shutil.copy(config.get_temporary_directory() + "/" + filename, config.get_data_directory() + "/" + image_id) shutil.copy(config.get_temporary_directory() + "/" + filename, config.get_data_directory() + "/" + image_id)