Merge "Add client search for sql"
This commit is contained in:
commit
5aaf629218
|
@ -372,7 +372,6 @@ def filter_tuple_by_search_opt(tuples, search=None):
|
|||
def get_client(user_id, project_id=None, client_id=None, offset=0,
|
||||
limit=100, search=None):
|
||||
|
||||
search = search or {}
|
||||
clients = []
|
||||
session = get_db_session()
|
||||
with session.begin():
|
||||
|
@ -401,6 +400,13 @@ def get_client(user_id, project_id=None, client_id=None, offset=0,
|
|||
u'description': client.description}
|
||||
clients.append(clientmap)
|
||||
|
||||
# If search opt is wrong, filter will not work,
|
||||
# return all tuples.
|
||||
try:
|
||||
clients = filter_tuple_by_search_opt(clients, search)
|
||||
except Exception as e:
|
||||
LOG.error(e)
|
||||
|
||||
return clients
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue