changeset 1870:c25077c87b1d

base (blog/edit): added a way to block publishing by adding "publish": "false" in metadata file
author Goffi <goffi@goffi.org>
date Wed, 02 Mar 2016 19:46:01 +0100
parents 9d9d61d53684
children 64a40adccba4
files frontends/src/jp/cmd_blog.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/cmd_blog.py	Wed Mar 02 19:45:02 2016 +0100
+++ b/frontends/src/jp/cmd_blog.py	Wed Mar 02 19:46:01 2016 +0100
@@ -150,6 +150,12 @@
                     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")