Skip to content

Commit ef7bbb4

Browse files
committed
Address review comments
Signed-off-by: Tushar Goel <[email protected]>
1 parent 3dab859 commit ef7bbb4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

vulnerabilities/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ def weakness(self):
285285
return weakness
286286
except Exception as e:
287287
logger.warning(f"Could not find CWE {self.cwe_id}: {e}")
288-
return None
289288

290289
@property
291290
def name(self):

vulnerabilities/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def get_queryset(self):
117117
def get_context_data(self, **kwargs):
118118
context = super().get_context_data(**kwargs)
119119
weaknesses = self.object.weaknesses.all()
120-
weaknesses_present_in_db = [weakness for weakness in weaknesses if weakness.weakness]
120+
weaknesses_present_in_db = [
121+
weakness_object for weakness_object in weaknesses if weakness_object.weakness
122+
]
121123
context.update(
122124
{
123125
"vulnerability": self.object,

0 commit comments

Comments
 (0)