Merge pull request #923 from dod-ccpo/remove-unused-filter
Remove findFilter
This commit is contained in:
commit
4cb25d14f4
@ -1,7 +1,7 @@
|
||||
import re
|
||||
import datetime
|
||||
from atst.utils.localization import translate
|
||||
from flask import current_app as app, render_template
|
||||
from flask import render_template
|
||||
from jinja2 import contextfilter
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
|
||||
@ -26,15 +26,6 @@ def usPhone(number):
|
||||
return "+1 ({}) {} - {}".format(phone[0:3], phone[3:6], phone[6:])
|
||||
|
||||
|
||||
def findFilter(value, filter_name, filter_args=[]):
|
||||
if not filter_name:
|
||||
return value
|
||||
elif filter_name in app.jinja_env.filters:
|
||||
return app.jinja_env.filters[filter_name](value, *filter_args)
|
||||
else:
|
||||
raise ValueError("filter name {} not found".format(filter_name))
|
||||
|
||||
|
||||
def formattedDate(value, formatter="%m/%d/%Y"):
|
||||
if value:
|
||||
return value.strftime(formatter)
|
||||
@ -68,7 +59,6 @@ def register_filters(app):
|
||||
app.jinja_env.filters["iconSvg"] = iconSvg
|
||||
app.jinja_env.filters["dollars"] = dollars
|
||||
app.jinja_env.filters["usPhone"] = usPhone
|
||||
app.jinja_env.filters["findFilter"] = findFilter
|
||||
app.jinja_env.filters["formattedDate"] = formattedDate
|
||||
app.jinja_env.filters["dateFromString"] = dateFromString
|
||||
app.jinja_env.filters["pageWindow"] = pageWindow
|
||||
|
Loading…
x
Reference in New Issue
Block a user