From c3240b27e73ecb75c5f1c890f50a9eb3a3398f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 3 Aug 2020 21:17:25 +0800 Subject: [PATCH] Removed the unused dict template filter from the Mia core application. --- mia_core/templatetags/mia_core.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/mia_core/templatetags/mia_core.py b/mia_core/templatetags/mia_core.py index c5a126a..47a3494 100644 --- a/mia_core/templatetags/mia_core.py +++ b/mia_core/templatetags/mia_core.py @@ -217,23 +217,3 @@ def smart_month(value): if value.year == year and value.month == month: return gettext("Last Month") return defaultfilters.date(value, "Y/n") - - -@register.filter(name="dict") -def dict_value(value, arg): - """Returns an element in a dictionary. - - Args: - value (dict): The dictionary. - arg (str): The key. - - Returns: - any: The element in this dictionary. - """ - if not isinstance(value, dict): - return None - if not isinstance(arg, str): - return None - if arg not in value: - return None - return value[arg]