# HG changeset patch # User Goffi # Date 1458686035 -3600 # Node ID 70b1a29e133854bf34fd33776e35f374be4cc3a2 # Parent e28c6c4dffa5879cd4e41868276c62fb33e62a03 jp (blog): force deletion (without backup) when content is empty diff -r e28c6c4dffa5 -r 70b1a29e1338 frontends/src/jp/cmd_blog.py --- a/frontends/src/jp/cmd_blog.py Tue Mar 22 23:33:31 2016 +0100 +++ b/frontends/src/jp/cmd_blog.py Tue Mar 22 23:33:55 2016 +0100 @@ -310,6 +310,11 @@ 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