mirror of
https://github.com/alerta/alerta.git
synced 2025-05-16 06:11:39 +00:00
Get the canonical alert id when query history by id (#1125)
This commit is contained in:
parent
a8e66b457b
commit
8889a9a8c7
2 changed files with 9 additions and 1 deletions
alerta/database/backends/postgres
|
@ -89,7 +89,7 @@ class QueryBuilderImpl(QueryBuilder):
|
|||
# id
|
||||
ids = params.getlist('id')
|
||||
if len(ids) == 1:
|
||||
query.append('AND (id LIKE %(id)s OR last_receive_id LIKE %(id)s)')
|
||||
query.append('AND (alerts.id LIKE %(id)s OR last_receive_id LIKE %(id)s)')
|
||||
qvars['id'] = ids[0] + '%'
|
||||
elif ids:
|
||||
query.append('AND (id ~* (%(regex_id)s) OR last_receive_id ~* (%(regex_id)s))')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue