Skip to content

Commit

Permalink
fix(manager): fix the condition
Browse files Browse the repository at this point in the history
VULN-2789
  • Loading branch information
jdobes committed Sep 25, 2023
1 parent 0d0b6c7 commit 9a7f13a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manager/vulnerabilities_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ def __init__(self, rh_account_id, cve_cache_from, cve_cache_keepalive, cves_with
def _full_query(rh_account_id, join_type, count_subquery, args):
# When there are 0 affected systems and advisory_available filter is set to False, force False value in output
# even if the CVE have some advisory
if "advisory_available" in args and args["advisory_available"] is not None and True in args["advisory_available"]:
advisory_available_no_sys = (fn.COALESCE(CveMetadata.advisories_list, '[]') != SQL("'[]'"))
else:
if "advisory_available" in args and args["advisory_available"] is not None and False in args["advisory_available"] and \
True not in args["advisory_available"]:
advisory_available_no_sys = False
else:
advisory_available_no_sys = (fn.COALESCE(CveMetadata.advisories_list, '[]') != SQL("'[]'"))
return (CveMetadata
.select(CveMetadata.id.alias("cve_id"),
CveMetadata.cve.alias("cve_name"),
Expand Down

0 comments on commit 9a7f13a

Please sign in to comment.