canonical / ubuntu-com-security-api

The API for CVEs and USNs data.
17 stars 9 forks source link

Exclude hidden notices from related #94

Closed nottrobin closed 2 years ago

nottrobin commented 2 years ago

Notices with is_hidden should be excluded from the related_notices list on other notices.

See https://chat.canonical.com/canonical/channels/ua-fixesm-apps-by-invitation-beta/fdfw4db4cbb47m49w9n44g73ua.

QA

dotrun to run the site locally.

Go to http://0.0.0.0:8030/security/notices/USN-4381-2.json in the demo, see the output includes:

  "related_notices": [
    {
      "id": "USN-4381-1", 
      "packages": "python3-django, python-django"
    }
  ], 

Now run this to set is_hidden to true on that related notice:

$ docker exec security_db psql -U postgres
postgres=# update notice set is_hidden = true where id = 'USN-4381-1';

Refresh the USN page and see:

"related_notices": [],