From 1eb19d71e2d44a679422401c871ed3c084bfc547 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Thu, 17 Mar 2016 14:19:32 +0100
Subject: [PATCH] [common] Do not count docutils info messages as validation
 errors

---
 beat/web/common/utils.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/beat/web/common/utils.py b/beat/web/common/utils.py
index 9db3cc80e..8bf426e1b 100644
--- a/beat/web/common/utils.py
+++ b/beat/web/common/utils.py
@@ -101,10 +101,14 @@ def validate_restructuredtext(value):
         validation_list = []
         msg = 'Line %(line)d (severity %(level)d): %(message)s'
         for error in errors:
-            validation_list.append(ValidationError(
-                msg, code=error.type.lower(),
-                params=dict(line=error.line, level=error.level, message=error.message)))
-        raise ValidationError(validation_list)
+            #from docutils.parsers.rst module:
+            #debug(0), info(1), warning(2), error(3), severe(4)
+            if error.level > 1:
+              validation_list.append(ValidationError(
+                  msg, code=error.type.lower(),
+                  params=dict(line=error.line, level=error.level, message=error.message)))
+        if validation_list:
+            raise ValidationError(validation_list)
 
 def ensure_html(text):
     try:
-- 
GitLab