Skip to content

Commit

Permalink
Add group creation date to issues and group json
Browse files Browse the repository at this point in the history
Through the json interface currently there is no way to find when a
group was created. If an app for example uses /issues/vulnerable.json
and needs this information it currently additionally has to download the
group html for each group and parse the "Created date" from the html.

This MR adds group.created as 'date' to the issues and group json so for
example downloading /issues/vulnerable.json would include this
information and no additional download for each group is needed.

It uses Y-M-d date format same as is used for advisories creation date
in package json.
  • Loading branch information
jakedane committed May 8, 2023
1 parent c17735e commit 52020fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tracker/view/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def index_json(only_vulnerable=False):

json_entry = OrderedDict()
json_entry['name'] = group.name
json_entry['date'] = group.created.strftime('%Y-%m-%d')
json_entry['packages'] = entry['pkgs']
json_entry['status'] = group.status.label
json_entry['severity'] = group.severity.label
Expand Down
1 change: 1 addition & 0 deletions tracker/view/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def show_group_json(avg):

json_data = OrderedDict()
json_data['name'] = group.name
json_data['date'] = group.created.strftime('%Y-%m-%d')
json_data['packages'] = [package.pkgname for package in packages]
json_data['status'] = group.status.label
json_data['severity'] = group.severity.label
Expand Down

0 comments on commit 52020fe

Please sign in to comment.