Skip to content

fix: return 404 for unknown advisory IDs - #2397

Open
w3lld1 wants to merge 1 commit into
aboutcode-org:mainfrom
w3lld1:fix/advisory-invalid-id-404
Open

fix: return 404 for unknown advisory IDs#2397
w3lld1 wants to merge 1 commit into
aboutcode-org:mainfrom
w3lld1:fix/advisory-invalid-id-404

Conversation

@w3lld1

@w3lld1 w3lld1 commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • return no result when an advisory ID does not exist instead of propagating DoesNotExist
  • add regression coverage for an unknown advisory ID

Validation

  • python -m pytest -o addopts='' --nomigrations -q vulnerabilities/tests/test_same_avid_different_content_id.py (7 passed using SQLite)
  • black --check vulnerabilities/models.py vulnerabilities/tests/test_same_avid_different_content_id.py
  • isort --check-only vulnerabilities/models.py vulnerabilities/tests/test_same_avid_different_content_id.py
  • python -m compileall -q vulnerabilities/models.py vulnerabilities/tests/test_same_avid_different_content_id.py
  • git diff --check

The full PostgreSQL-backed suite is deferred to CI because PostgreSQL is not available in my local environment.

Fixes #2396

Signed-off-by: w3lld1 <42353747+w3lld1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Advisory Page Returns 500 Instead of 404 for Invalid Advisory IDs

1 participant