Removed the unused dict template filter from the Mia core application.

This commit is contained in:
依瑪貓 2020-08-03 21:17:25 +08:00
parent 18161c3fb2
commit c3240b27e7

View File

@ -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]