File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ def get_contacts(search_text):
15
15
16
16
names = search_text .split (" " )
17
17
if len (names ) == 2 :
18
- query = text ("select * from pdp_contacts where archived_date is null AND\
19
- lower(first_name) like lower(:name1) and lower(last_name) like lower(:name2) \
20
- OR lower(first_name) like lower(:name2) and lower(last_name) like lower(:name1)" )
18
+ query = text ("select * from pdp_contacts where archived_date is null AND ( \
19
+ ( lower(first_name) like lower(:name1) and lower(last_name) like lower(:name2) ) \
20
+ OR ( lower(first_name) like lower(:name2) and lower(last_name) like lower(:name1)) )" )
21
21
query_result = connection .execute (query , name1 = '{}%' .format (names [0 ]), name2 = '{}%' .format (names [1 ]))
22
22
elif len (names ) == 1 :
23
23
query = text ("select * from pdp_contacts \
You can’t perform that action at this time.
0 commit comments