Commit 8432534d authored by carlosribas's avatar carlosribas
Browse files

Check if message exists

parent 546e4040
......@@ -120,9 +120,11 @@ limitations under the License.
</noscript>
<div ng-show="!displaySearchInterface">
<div id="show-message">
{% include "portal/message" %}
</div>
{% if "portal/message"|template_exists %}
<div id="show-message">
{% include "portal/message" %}
</div>
{% endif %}
{% block content %}{% endblock %}
</div>
<text-search-results ng-if="displaySearchInterface"></text-search-results>
......
......@@ -13,6 +13,7 @@ limitations under the License.
from django import template
from django.conf import settings
from django.template.defaultfilters import stringfilter
from portal.config.expert_databases import expert_dbs
register = template.Library()
......@@ -46,3 +47,13 @@ def get_ebi_search_endpoint():
passed to javascript.
"""
return settings.EBI_SEARCH_ENDPOINT
@register.filter
@stringfilter
def template_exists(value):
try:
template.loader.get_template(value)
return True
except template.TemplateDoesNotExist:
return False
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