Skip to content

Commit 660375a

Browse files
committed
Fix models
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent ed06995 commit 660375a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

vulnerabilities/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,8 @@ def from_purl(self, purl: Union[PackageURL, str]):
34773477
"""
34783478
Return a new Package given a ``purl`` PackageURL object or PURL string.
34793479
"""
3480-
return PackageV2.objects.create(**purl_to_dict(purl=purl))
3480+
package, _ = PackageV2.objects.get_or_create(**purl_to_dict(purl=purl))
3481+
return package
34813482

34823483

34833484
class PackageV2(PackageURLMixin):

0 commit comments

Comments
 (0)