changeset 1924:70b1a29e1338

jp (blog): force deletion (without backup) when content is empty
author Goffi <goffi@goffi.org>
date Tue, 22 Mar 2016 23:33:55 +0100
parents e28c6c4dffa5
children 53b51866747f
files frontends/src/jp/cmd_blog.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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