Commit 2a55cd5c authored by Dominik Janků's avatar Dominik Janků

Update filters.py

There are some programmers using unicode strings by default in Python 2 (from __future__ import unicode_literals). In that case "str.lower" raises TypeError (str type is expected, unicode given). This propose fixed mentioned issue.
parent 8ecf9dcf
...@@ -266,7 +266,7 @@ def convert(*args): ...@@ -266,7 +266,7 @@ def convert(*args):
See :mod:`flask_admin.contrib.sqla.filters` for usage example. See :mod:`flask_admin.contrib.sqla.filters` for usage example.
""" """
def _inner(func): def _inner(func):
func._converter_for = list(map(str.lower, args)) func._converter_for = list(map(lambda x: x.lower(), args))
return func return func
return _inner return _inner
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment