SACGF / SACGF/variantgrid

Harden views against bad URL/param input (500 instead of 404/400): genome build, allele=, grouping id

Open
#1,601 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
30
Forks
3
Avg merge
9h 28m
Merged PRs (30d)
42

Description

🤖 Written by Claude

A cluster of unvalidated URL/query inputs that raise **500s instead of 404/400**, on shariant / variantgrid.com prod. Same fix pattern (`get_object_or_404` / validate-then-400). Grouping the prod-relevant ones:

- **Misspelled genome build in `/view_variant` URL** → `GenomeBuild.get_name_or_alias()` raises `DoesNotExist` (no try/except). `variantopedia/views.py:386`
- **Stale grouping/overlap id** → `ClassificationGrouping`/`Overlap` `.get()` with no 404 handling. `classification/views/views.py:971`

Each should return a friendly 404 rather than a 500.

_(The non-numeric `allele=` export-param case is split into #1615 — `a` is the allele search shortcut, so `allele=a9678` should be cleaned/accepted rather than rejected.)_

**Rollbar:**
- https://app.rollbar.com/a/jimmy.andrews/fix/item/VariantGrid/7150
- https://app.rollbar.com/a/jimmy.andrews/fix/item/VariantGrid/7204
- https://app.rollbar.com/a/jimmy.andrews/fix/item/VariantGrid/5989

_(Filed from a 6-month Rollbar triage.)_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.