Rev2127, Fix delete files without file_info

This commit is contained in:
shortcutme 2017-06-27 18:08:28 +02:00
parent 401d3ec1c9
commit 03cabcb07c
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv): def __init__(self, argv):
self.version = "0.5.6" self.version = "0.5.6"
self.rev = 2125 self.rev = 2127
self.argv = argv self.argv = argv
self.action = None self.action = None
self.config_file = "zeronet.conf" self.config_file = "zeronet.conf"

View file

@ -533,7 +533,7 @@ class UiWebsocket(object):
return self.response(to, {"error": "Forbidden, you can only modify your own files"}) return self.response(to, {"error": "Forbidden, you can only modify your own files"})
file_info = self.site.content_manager.getFileInfo(inner_path) file_info = self.site.content_manager.getFileInfo(inner_path)
if file_info.get("optional"): if file_info and file_info.get("optional"):
self.log.debug("Deleting optional file: %s" % inner_path) self.log.debug("Deleting optional file: %s" % inner_path)
relative_path = file_info["relative_path"] relative_path = file_info["relative_path"]
content_json = self.site.storage.loadJson(file_info["content_inner_path"]) content_json = self.site.storage.loadJson(file_info["content_inner_path"])