Skip to content

Commit

Permalink
feat: add an EMPTY ecosystem for withdrawn records
Browse files Browse the repository at this point in the history
  • Loading branch information
hogo6002 committed Oct 7, 2024
1 parent 649fd23 commit c6dd919
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ def _pre_put_hook(self): # pylint: disable=arguments-differ
if 'GIT' in ecosystems_set:
break

# If a withdrawn record has no affected package,
# assign an 'EMPTY' ecosystem value for export.
if not ecosystems_set:
ecosystems_set.add('EMPTY')

# For all ecosystems that specify a specific version with colon,
# also add the base name
ecosystems_set.update({ecosystems.normalize(x) for x in ecosystems_set})
Expand Down

0 comments on commit c6dd919

Please sign in to comment.