Fix query for version-specific security support list

When asking for version x, we should still list all versions the patch
in question applies to, not limit it to the current one.
This commit is contained in:
Magnus Hagander
2018-01-26 11:18:02 +01:00
parent e896caf1d4
commit 89f7171bfd

View File

@ -25,6 +25,7 @@ def version(request, numtree):
version = get_object_or_404(Version, tree=numtree)
# It's safe to pass in the value since we get it from the module, not from
# the actual querystring.
return _list_patches(request, "EXISTS (SELECT 1 FROM security_securitypatchversion svv WHERE svv.version_id={0} AND svv.patch_id=p.id)".format(version.id))
return _list_patches(request, "v.id={0}".format(version.id))
patches = SecurityPatch.objects.filter(public=True, versions=version).distinct()