Skip to content
Snippets Groups Projects
Commit aab39d18 authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Make extraction of inspection errors indirect

parent ddadd84c
No related branches found
No related tags found
No related merge requests found
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
{%- endif %} {%- endif %}
{%- if permission_can('power') %} {%- if permission_can('power') %}
{%- set tmpval = item.get_jpath_values('_CESNET.InspectionErrors') %} {%- set tmpval = item.get_inspection_errors() %}
{%- if tmpval %} {%- if tmpval %}
<hr> <hr>
<h4>{{ _('Inspection errors') }} {{ get_icon('role-admin') }}</h4> <h4>{{ _('Inspection errors') }} {{ get_icon('role-admin') }}</h4>
......
...@@ -356,6 +356,15 @@ class Idea(idea.lite.Idea): # pylint: disable=locally-disabled,too-many-ancesto ...@@ -356,6 +356,15 @@ class Idea(idea.lite.Idea): # pylint: disable=locally-disabled,too-many-ancesto
self.get('_CESNET', {}).get('SourceResolvedASN', []) self.get('_CESNET', {}).get('SourceResolvedASN', [])
) )
def get_inspection_errors(self):
"""
Convenience method for returning a list of inspection errors.
:return: List of values of ``idea['_CESNET']['InspectionErrors']``.
:rtype: list
"""
return self.get_jpath_values('_CESNET.InspectionErrors')
def get_jpath_value(self, jpath): def get_jpath_value(self, jpath):
""" """
Return single (first in case o a list) value on given JPath within the Return single (first in case o a list) value on given JPath within the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment