Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#10927 closed (fixed)

Content Types shortcut view throws 500s easily

Reported by: Jeremy Dunck 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 Jeremy Dunck 8 years ago.
More robust shortcut view, with tests.
shortcut.diff (2.8 KB) - added by Alex Gaynor 8 years ago.
simpler :)

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by Jeremy Dunck

Attachment: 10927.diff added

More robust shortcut view, with tests.

comment:1 Changed 8 years ago by Jeremy Dunck

Has patch: set

comment:2 Changed 8 years ago by Alex Gaynor

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 8 years ago by Alex Gaynor

Err sorry, I misread the patch.

Changed 8 years ago by Alex Gaynor

Attachment: shortcut.diff added

simpler :)

comment:4 Changed 8 years ago by Jeremy Dunck

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 8 years ago by Chris Beaven

Triage Stage: UnreviewedReady for checkin

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

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

Cc: semente@… added

comment:7 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(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 7 years ago by Luke Plant

(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