Fixes issue where domains without any associated certificates are not searchable. (#797)

This commit is contained in:
kevgliss 2017-05-15 19:07:32 -07:00 committed by GitHub
parent 092ce0f9d8
commit 8c41c6785d
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,7 @@ def render(args):
:param args:
:return:
"""
query = database.session_query(Domain).join(Certificate, Domain.certificate)
query = database.session_query(Domain)
filt = args.pop('filter')
certificate_id = args.pop('certificate_id', None)
@ -85,6 +85,7 @@ def render(args):
query = database.filter(query, Domain, terms)
if certificate_id:
query = query.join(Certificate, Domain.certificates)
query = query.filter(Certificate.id == certificate_id)
return database.sort_and_page(query, Domain, args)