Skip to content
Snippets Groups Projects
Verified Commit ed2fa9a4 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Return None in get_dict if key does not exist.

This is wrong from a Python point of view, but the default in the
Django Template Language.
parent 0de14046
No related branches found
No related tags found
No related merge requests found
......@@ -7,4 +7,4 @@ register = template.Library()
@register.filter
def get_dict(value: Dict[Any, Any], arg: Any) -> Any:
return value[arg]
return value.get(arg, None)
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