Commit 25e07e13 authored by chrissi^'s avatar chrissi^
Browse files

plugins/blog: Warn if an update is omitted and fix warnings

parent 05aa26bf
......@@ -4,6 +4,7 @@ branches:
date: 2019-09-24
- name: v2018.2.3-ffbs-201909161954-beta
channel: beta
date: 2019-09-16
site: "https://gitli.stratum0.org/ffbs/ffbs-site/commit/b37e28d2135c9023ff4dd6c3ebfb0cebc41f2d06"
gluon: "https://gitli.stratum0.org/ffbs/ffbs-gluon/tree/v2018.2.3-ffbs"
rtd: "https://gluon.readthedocs.io/en/v2018.2.x/releases/v2018.2.3.html"
......
......@@ -4,6 +4,7 @@ branches:
date: 2019-09-28
- name: v2019.1-ffbs-201909262250-beta
channel: beta
date: 2019-09-26
site: "https://gitli.stratum0.org/ffbs/ffbs-site/commit/82210db53b97480c8d763bf869da55ac17598f62"
gluon: "https://gitli.stratum0.org/ffbs/ffbs-gluon/tree/v2019.1-ffbs"
rtd: "https://gluon.readthedocs.io/en/v2019.1.x/releases/v2019.1.html"
......
from flamingo.core.data_model import Content
import logging
logger = logging.getLogger("project.plugin.blog")
class Blog:
def contents_parsed(self, context):
......@@ -9,6 +12,7 @@ class Blog:
if "blog" in content:
for b in content["blog"]:
if not ("date" in b and "title" in b and "body" in b):
logger.warn("blog entry in article {} is malformed! 'date', 'title' or 'body' is missing!".format(content["path"]))
continue
c = Content()
c["date"] = b["date"]
......@@ -24,6 +28,7 @@ class Blog:
for content in context.contents.filter(path__startswith="firmware/v").order_by("-content_title"):
for branch in content["branches"]:
if not ("date" in branch and "channel" in branch and "name" in branch):
logger.warn("firmware entry in file {} is malformed! 'date', 'channel' or 'name' missing for branch {}".format(content["path"], branch))
continue
c = Content()
c["date"] = branch["date"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment