Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#10927 closed (fixed)

Content Types shortcut view throws 500s easily

Reported by: jdunck Owned by: nobody
Component: Contrib apps Version: 1.1-beta
Severity: Keywords:
Cc: semente@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

BaseHandler.handle_uncaught_exception calls mail_admins any time an uncaught exception occurs. In my general usage, this is very rare.

The contenttypes.views.shortcut view, many arbitrary URLs will throw a 500. Since crawlers probe URL spaces, this leads to a lot of noise in error emails.

Attachments (2)

10927.diff (3.7 KB) - added by jdunck 6 years ago.
More robust shortcut view, with tests.
shortcut.diff (2.8 KB) - added by Alex 6 years ago.
simpler :)

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by jdunck

More robust shortcut view, with tests.

comment:1 Changed 6 years ago by jdunck

  • Has patch set

comment:2 Changed 6 years ago by Alex

Why does this raise a 404 if the PK isn't an integer? That's not the correct behavior as we support all sorts of other pks.

comment:3 Changed 6 years ago by Alex

Err sorry, I misread the patch.

Changed 6 years ago by Alex

simpler :)

comment:4 Changed 6 years ago by jdunck

The simpler one probably works-for-me. I chose the .to_python route because that uniformly raises ValidationError-- I wasn't sure about the assumption that any cast in the ORM would fail as ValueError.

comment:5 Changed 6 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Ready for checkin

Reviewed - looks good and the tests prove it works :)

comment:6 Changed 6 years ago by Guilherme Gondim <semente@…>

  • Cc semente@… added

comment:7 Changed 5 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from new to closed

(In [11917]) Fixed #10927 - Content Types shortcut view throws 500s instead of 404s

Thanks to Jeremy Dunck/Alex Gaynor for the patch

comment:8 Changed 5 years ago by lukeplant

(In [11919]) [1.1.X] Fixed #10927 - Content Types shortcut view throws 500s instead of 404s

Thanks to Jeremy Dunck/Alex Gaynor for the patch

Backport of r11917 from trunk

Note: See TracTickets for help on using tickets.
Back to Top