Merge pull request #2101 from castrapel/left_outer_join
Left outer join on domains tables to avoid missing results
This commit is contained in:
commit
661bc9cc13
|
@ -178,6 +178,8 @@ def render(args):
|
||||||
terms = filt.split(';')
|
terms = filt.split(';')
|
||||||
if 'active' in filt:
|
if 'active' in filt:
|
||||||
query = query.filter(Authority.active == truthiness(terms[1]))
|
query = query.filter(Authority.active == truthiness(terms[1]))
|
||||||
|
elif 'cn' in filt:
|
||||||
|
query = query.join(Authority.active == truthiness(terms[1]))
|
||||||
else:
|
else:
|
||||||
query = database.filter(query, Authority, terms)
|
query = database.filter(query, Authority, terms)
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ def render(args):
|
||||||
elif 'id' in terms:
|
elif 'id' in terms:
|
||||||
query = query.filter(Certificate.id == cast(terms[1], Integer))
|
query = query.filter(Certificate.id == cast(terms[1], Integer))
|
||||||
elif 'name' in terms:
|
elif 'name' in terms:
|
||||||
query = query.join(certificate_associations).join(Domain).filter(
|
query = query.outerjoin(certificate_associations).outerjoin(Domain).filter(
|
||||||
or_(
|
or_(
|
||||||
Certificate.name.ilike(term),
|
Certificate.name.ilike(term),
|
||||||
Domain.name.ilike(term),
|
Domain.name.ilike(term),
|
||||||
|
|
Loading…
Reference in New Issue