statuses
This commit is contained in:
parent
9e82178c66
commit
64c04ec812
|
@ -40,8 +40,7 @@ statuses = {
|
||||||
# Создаем кастомный фильтр для форматирования дат
|
# Создаем кастомный фильтр для форматирования дат
|
||||||
def format_status(value):
|
def format_status(value):
|
||||||
res = statuses[str(value)] if hasattr(statuses, str(value)) else value
|
res = statuses[str(value)] if hasattr(statuses, str(value)) else value
|
||||||
return res[0] if len(res) else value
|
return res
|
||||||
|
|
||||||
|
|
||||||
# Регистрируем фильтр в Jinja2Templates
|
# Регистрируем фильтр в Jinja2Templates
|
||||||
templates.env.filters["format_status"] = format_status
|
templates.env.filters["format_status"] = format_status
|
||||||
|
|
Loading…
Reference in New Issue