Skip to content

Commit

Permalink
RDF template returns server error if package has no extras
Browse files Browse the repository at this point in the history
In very special situations, pkg_dict hasn't such key as 'extras'.
it results in server error, because rdf template uses `None` as
fallback value.

Replaced it with empty list - it's more logically
  • Loading branch information
smotornyuk authored and amercader committed Sep 14, 2016
1 parent 23101f1 commit ad2cb6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/templates/package/read.rdf
Expand Up @@ -59,7 +59,7 @@
<dct:rights rdf:resource="{{c.pkg_dict['license_url']}}"/>
{% endif %}

{% for extra_dict in c.pkg_dict.get('extras',None) %}
{% for extra_dict in c.pkg_dict.get('extras',[]) %}
<dct:relation>
<rdf:Description>
<rdfs:label>{{extra_dict.get('key','')}}</rdfs:label>
Expand Down

0 comments on commit ad2cb6e

Please sign in to comment.