Skip to content

Commit 1f4050a

Browse files
committed
refactor: just don't include warnings by default
1 parent ae5846a commit 1f4050a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

scripts/generate_osv_advisories.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,11 @@ def build_affected_range(constraint: str) -> osv.Range:
281281
ran: osv.Range = {
282282
'type': 'ECOSYSTEM',
283283
'events': events,
284-
'database_specific': {'constraint': constraint, 'warnings': warnings},
284+
'database_specific': {'constraint': constraint},
285285
}
286286

287-
# don't retain the warnings property if its empty
288-
if len(ran['database_specific']['warnings']) == 0:
289-
del ran['database_specific']['warnings']
287+
if len(warnings) > 0:
288+
ran['database_specific']['warnings'] = warnings
290289

291290
return ran
292291

0 commit comments

Comments
 (0)