Skip to content

Commit f245491

Browse files
committed
Add new Weakness.cwe property
This is the CWE-prefixed value that we want to commonly display. Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 670814b commit f245491

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vulnerabilities/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ class Weakness(models.Model):
315315
vulnerabilities = models.ManyToManyField(Vulnerability, related_name="weaknesses")
316316
db = Database()
317317

318+
@property
319+
def cwe(self):
320+
return f"CWE-{self.cwe_id}"
321+
318322
@property
319323
def weakness(self):
320324
"""

0 commit comments

Comments
 (0)