Skip to content
Snippets Groups Projects
Commit 5697f181 authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Fix: Make the search by name and description case insensitive. (Redmine issue: #7628)

parent f1428112
No related branches found
No related tags found
No related merge requests found
...@@ -110,8 +110,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView): ...@@ -110,8 +110,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
query = query \ query = query \
.filter( .filter(
or_( or_(
model.name.like('%{}%'.format(form_args['search'])), model.name.ilike('%{}%'.format(form_args['search'])),
model.description.like('%{}%'.format(form_args['search'])), model.description.ilike('%{}%'.format(form_args['search'])),
) )
) )
# Adjust query based on lower time boudary selection. # Adjust query based on lower time boudary selection.
......
...@@ -224,9 +224,9 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView): ...@@ -224,9 +224,9 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
query = query \ query = query \
.filter( .filter(
or_( or_(
model.name.like('%{}%'.format(form_args['search'])), model.name.ilike('%{}%'.format(form_args['search'])),
model.filter.like('%{}%'.format(form_args['search'])), model.filter.ilike('%{}%'.format(form_args['search'])),
model.description.like('%{}%'.format(form_args['search'])), model.description.ilike('%{}%'.format(form_args['search'])),
) )
) )
# Adjust query based on lower time boudary selection. # Adjust query based on lower time boudary selection.
......
...@@ -135,8 +135,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView): ...@@ -135,8 +135,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
query = query \ query = query \
.filter( .filter(
or_( or_(
model.name.like('%{}%'.format(form_args['search'])), model.name.ilike('%{}%'.format(form_args['search'])),
model.description.like('%{}%'.format(form_args['search'])), model.description.ilike('%{}%'.format(form_args['search'])),
) )
) )
# Adjust query based on lower time boundary selection. # Adjust query based on lower time boundary selection.
......
...@@ -125,8 +125,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView): ...@@ -125,8 +125,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
query = query \ query = query \
.filter( .filter(
or_( or_(
model.netname.like('%{}%'.format(form_args['search'])), model.netname.ilike('%{}%'.format(form_args['search'])),
model.description.like('%{}%'.format(form_args['search'])) model.description.ilike('%{}%'.format(form_args['search']))
) )
) )
# Adjust query based on lower time boudary selection. # Adjust query based on lower time boudary selection.
......
...@@ -134,8 +134,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView): ...@@ -134,8 +134,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
.filter( .filter(
or_( or_(
model.login.like('%{}%'.format(form_args['search'])), model.login.like('%{}%'.format(form_args['search'])),
model.fullname.like('%{}%'.format(form_args['search'])), model.fullname.ilike('%{}%'.format(form_args['search'])),
model.email.like('%{}%'.format(form_args['search'])), model.email.ilike('%{}%'.format(form_args['search'])),
) )
) )
# Adjust query based on lower time boundary selection. # Adjust query based on lower time boundary selection.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment