openknowledge-archive / dpr-api

DEPRECATED - Data Package Registry API and Frontend
http://frictionlessdata.io/
MIT License
7 stars 6 forks source link

[bug] _snippets.html throwing error if readme is None #236

Closed subhankarb closed 7 years ago

subhankarb commented 7 years ago

In search page view, the macro from _snippets.html is throwing error if readme file is null.


File "/var/task/app/templates/base.html", line 63, in top-level template code
{% block content %}{{content}}{% endblock %}
File "/var/task/app/templates/search.html", line 10, in block "content"
{{ snippets.search_package_list(datapackage_list) }}
File "/tmp/pip-build-dYJHX4/Jinja2/jinja2/runtime.py", line 551, in _invoke
File "/var/task/app/templates/_snippets.html", line 172, in template
{{ package.readme|truncate(50) }}
File "/tmp/pip-build-dYJHX4/Jinja2/jinja2/filters.py", line 495, in do_truncate
TypeError: object of type 'NoneType' has no len()```
subhankarb commented 7 years ago

FIXED. Fixed with #237