From d6c6cb96ba10c82cafc55eb63bbe48e64bce3946 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 5 Aug 2021 01:24:49 +0200 Subject: [PATCH] make keyvalue non-existing key tolerant --- InvenTree/part/templatetags/inventree_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 5ebc939305..dce3d248e5 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -269,7 +269,7 @@ def keyvalue(dict, key): usage: {% mydict|keyvalue:mykey %} """ - return dict[key] + return dict.get(key) @register.simple_tag()