[diagnostic] Add rule_id to CompatError
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 02 Nov 2017 20:58:46 +0100
changeset 2829 5c0fd172aa59
parent 2828 4921e19f5e62
child 2830 0f8765b71510
[diagnostic] Add rule_id to CompatError This will be used later to filter among errors during testing. Related to #39302963.
cubicweb_seda/entities/diag.py
--- a/cubicweb_seda/entities/diag.py	Thu Nov 02 20:55:49 2017 +0100
+++ b/cubicweb_seda/entities/diag.py	Thu Nov 02 20:58:46 2017 +0100
@@ -111,7 +111,8 @@
 }
 
 
-class CompatError(namedtuple('_CompatError', ['impacted_formats', 'message', 'tab_id', 'entity'])):
+class CompatError(namedtuple('_CompatError', [
+        'impacted_formats', 'message', 'tab_id', 'entity', 'rule_id'])):
     """Convenience class holding information about a problem in a profile forbidding export to some
     format:
 
@@ -126,7 +127,7 @@
         message = kwargs.get('message', rule.message)
         tab_id = kwargs.get('tab_id', rule.tab_id)
         return super(CompatError, cls).__new__(
-            cls, impacted_formats, message, tab_id, entity)
+            cls, impacted_formats, message, tab_id, entity, rule_id)
 
 
 class ISEDACompatAnalyzer(EntityAdapter):