0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-05-17 14:42:22 +00:00

Allow users to belong to multiple customers ()

This commit is contained in:
Nick Satterly 2018-04-08 23:23:55 +02:00 committed by GitHub
parent 9b00d9ee7b
commit 7f0413cf5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 145 additions and 138 deletions
alerta/database/backends/postgres

View file

@ -24,9 +24,9 @@ class QueryBuilderImpl(QueryBuilder):
qvars = dict()
# customer
if g.get('customer', None):
query.append('AND customer=%(customer)s')
qvars['customer'] = g.get('customer')
if g.get('customers', None):
query.append('AND customer=ANY(%(customers)s)')
qvars['customers'] = g.get('customers')
# from-date, to-date
from_date = params.get('from-date', default=None, type=DateTime.parse)