Commit bc79d74
committed
Return 404 instead of 500 for unknown advisory pages
AdvisoryV2QuerySet.latest_for_avid() used .get() and raised an
unhandled DoesNotExist for an unknown avid, so advisory detail URLs
such as /advisories/pysec/PYSEC-3000-0 returned a server error. All
three detail views calling it already check for a None return and
raise Http404, so return None from the queryset method instead.
Closes #2396
Signed-off-by: Manoj Gowda <manojgowdabs18@gmail.com>1 parent adc81cb commit bc79d74
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2926 | 2926 | | |
2927 | 2927 | | |
2928 | 2928 | | |
2929 | | - | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2930 | 2932 | | |
2931 | 2933 | | |
2932 | 2934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
0 commit comments