File tree 3 files changed +3
-6
lines changed
3 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,6 @@ def bulk_search(self, request):
176
176
177
177
178
178
class VulnerabilityFilterSet (filters .FilterSet ):
179
- vulnerability_id = filters .CharFilter (field_name = "vulnerability_id" )
180
179
181
180
class Meta :
182
181
model = Vulnerability
Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ def process_advisories(data_source: DataSource) -> None:
118
118
# Treat updated_advisories and added_advisories as same. Eventually
119
119
# we want to refactor all data sources to provide advisories via a
120
120
# single method.
121
- vulcoid_timestamp = datetime .datetime .now ()
122
121
advisory_batches = chain (data_source .updated_advisories (), data_source .added_advisories ())
123
122
for batch in advisory_batches :
124
123
for advisory in batch :
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class Vulnerability(models.Model):
44
44
45
45
vulnerability_id = models .CharField (
46
46
max_length = 50 ,
47
- help_text = "Unique vulnerability_id for a vulnerability: this is either a published CVE id"
47
+ help_text = "Unique identifier for a vulnerability: this is either a published CVE id"
48
48
" (as in CVE-2020-7965) if it exists. Otherwise this is a VulnerableCode-assigned VULCOID"
49
49
" (as in VULCOID-20210222-1315-16461541). When a vulnerability CVE is assigned later we"
50
50
" replace this with the CVE and keep the 'old' VULCOID in the 'old_vulnerability_id'"
@@ -63,9 +63,8 @@ class Vulnerability(models.Model):
63
63
)
64
64
65
65
def save (self , * args , ** kwargs ):
66
- if self .vulnerability_id :
67
- return super ().save (* args , ** kwargs )
68
- self .vulnerability_id = self .generate_vulcoid ()
66
+ if not self .vulnerability_id :
67
+ self .vulnerability_id = self .generate_vulcoid ()
69
68
return super ().save (* args , ** kwargs )
70
69
71
70
@staticmethod
You can’t perform that action at this time.
0 commit comments