base (blog/edit): added a way to block publishing by adding "publish": "false" in metadata file
This commit is contained in:
parent
b67ee6bb47
commit
41f19f63ec
1 changed files with 6 additions and 0 deletions
|
|
@ -150,6 +150,12 @@ class Edit(base.CommandBase):
|
|||
file_path=tmp_file_path, meta_path=meta_file_path), error=True)
|
||||
self.host.quit(1)
|
||||
|
||||
if not C.bool(mb_data.get('publish', "true")):
|
||||
self.disp(u'Publication blocked by "publish" key in metadata, cancelling edition.\n\n' +
|
||||
"temporary file path:\t{file_path}\nmetadata file path:\t{meta_path}".format(
|
||||
file_path=tmp_file_path, meta_path=meta_file_path), error=True)
|
||||
self.host.quit(0)
|
||||
|
||||
if len(content) == 0:
|
||||
self.disp(u"Content is empty, cancelling the blog edition")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue