Skip to content
Snippets Groups Projects
Commit f31aed88 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

templates/apidoc: Display all api results different from null

parent 9a8e1f98
No related branches found
No related tags found
No related merge requests found
......@@ -63,15 +63,18 @@ def urlize_links_and_mails(text):
The text as is otherwise.
"""
if 'href="' not in text:
text = re.sub(r'(/api/[^"<]*|/browse/[^"<]*|http.*$)',
r'<a href="\1">\1</a>',
text)
return re.sub(r'([^ <>"]+@[^ <>"]+)',
r'<a href="mailto:\1">\1</a>',
text)
else:
return text
try:
if 'href="' not in text:
text = re.sub(r'(/api/[^"<]*|/browse/[^"<]*|http.*$)',
r'<a href="\1">\1</a>',
text)
return re.sub(r'([^ <>"]+@[^ <>"]+)',
r'<a href="mailto:\1">\1</a>',
text)
except Exception:
pass
return text
@register.filter
......
......@@ -38,7 +38,7 @@ See top-level LICENSE file for more information
{{ description | safe_docstring_display | safe }}
</div>
{% endif %}
{% if response_data %}
{% if response_data is not None %}
<div>
<h4>Request</h4>
<pre><strong>{{ request.method }}</strong> {{ request.path }}</pre>
......
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