make keyvalue non-existing key tolerant

This commit is contained in:
Matthias 2021-08-05 01:24:49 +02:00
parent 58f2dce18d
commit d6c6cb96ba
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -269,7 +269,7 @@ def keyvalue(dict, key):
usage: usage:
{% mydict|keyvalue:mykey %} {% mydict|keyvalue:mykey %}
""" """
return dict[key] return dict.get(key)
@register.simple_tag() @register.simple_tag()