Exclude security notices with no CVE from list of CVEs in sitemap

Otherwise we're instructing google and others to index pages that don't
exist.
This commit is contained in:
Magnus Hagander
2021-04-09 15:20:56 +02:00
parent 44415d86a9
commit 368550f2ee

View File

@ -5,5 +5,5 @@ from .models import SecurityPatch
def get_struct():
"""create sitemap entries for each CVE entry and the top level CVE URL"""
yield ('support/security/', None)
for s in SecurityPatch.objects.filter(public=True).order_by('-cvenumber'):
for s in SecurityPatch.objects.filter(public=True).exclude(cve='').order_by('-cvenumber'):
yield ('support/security/CVE-{}'.format(s.cve), None)