From e3623e67efd286a3575ea4d6dfd22e80ae1d11ae Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 22 Mar 2016 23:33:55 +0100 Subject: [PATCH] jp (blog): force deletion (without backup) when content is empty --- frontends/src/jp/cmd_blog.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontends/src/jp/cmd_blog.py b/frontends/src/jp/cmd_blog.py index 4872b968..2614ec35 100644 --- a/frontends/src/jp/cmd_blog.py +++ b/frontends/src/jp/cmd_blog.py @@ -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