jp (blog): force deletion (without backup) when content is empty
This commit is contained in:
parent
9d304eec88
commit
e3623e67ef
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue