Skip to content

Commit 030bd8a

Browse files
authored
Merge pull request #179 from CodeForPhilly/178
Fix for 178: Two WHEREs in SQL query
2 parents dbb013b + d5e99f5 commit 030bd8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/api/common_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_contacts(search_text):
1515
names = search_text.split(" ")
1616
if len(names) == 2:
1717
query = text("select * from pdp_contacts where archived_date is null AND\
18-
where lower(first_name) like lower(:name1) and lower(last_name) like lower(:name2) \
18+
lower(first_name) like lower(:name1) and lower(last_name) like lower(:name2) \
1919
OR lower(first_name) like lower(:name2) and lower(last_name) like lower(:name1)")
2020
query_result = connection.execute(query, name1='{}%'.format(names[0]), name2='{}%'.format(names[1]))
2121
elif len(names) == 1:

0 commit comments

Comments
 (0)