Respect fetch_related for fetch_advisories

This commit is contained in:
Mustafa Gezen 2023-02-05 01:18:34 +01:00
parent 2763793211
commit 19d514830a
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -84,16 +84,17 @@ async def fetch_advisories(
count = results[1][0]["total"]
advisories = [Advisory(**x) for x in results[1]]
for advisory in advisories:
await advisory.fetch_related(
"packages",
"cves",
"fixes",
"affected_products",
"packages",
"packages__supported_product",
"packages__supported_products_rh_mirror",
)
if fetch_related:
for advisory in advisories:
await advisory.fetch_related(
"packages",
"cves",
"fixes",
"affected_products",
"packages",
"packages__supported_product",
"packages__supported_products_rh_mirror",
)
return (
count,
advisories,