Skip to content

Commit 663f43e

Browse files
committed
Fix model properties to avoid dups
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent 7a26cb9 commit 663f43e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vulnerabilities/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def resolved_to(self):
8686
Returns packages, which first received patch against this vulnerability
8787
in their particular version history.
8888
"""
89-
return self.patched_packages.all()
89+
return self.patched_packages.all().distinct()
9090

9191
def __str__(self):
9292
return self.vulnerability_id or self.summary
@@ -150,7 +150,7 @@ def resolved_to(self):
150150
"""
151151
Returns the vulnerabilities which this package is patched against.
152152
"""
153-
return self.resolved_vulnerabilities.all()
153+
return self.resolved_vulnerabilities.all().distinct()
154154

155155
class Meta:
156156
unique_together = ("name", "namespace", "type", "version", "qualifiers", "subpath")

0 commit comments

Comments
 (0)