jp (blog): force deletion (without backup) when content is empty

This commit is contained in:
Goffi 2016-03-22 23:33:55 +01:00
commit e3623e67ef

View file

@ -310,6 +310,11 @@ class Edit(base.CommandBase, BlogCommon):
if len(content) == 0:
self.disp(u"Content is empty, cancelling the blog edition")
self.disp(u"Deletion of {}".format(content_file_path.decode('utf-8')), 2)
os.unlink(content_file_path)
self.disp(u"Deletion of {}".format(meta_file_path.decode('utf-8')), 2)
os.unlink(meta_file_path)
self.host.quit()
# time to re-check the hash
elif (tmp_ori_hash == hashlib.sha1(content).digest() and