Django

Code

Ticket #10360 (new)

Opened 2 years ago

Last modified 6 months ago

allow customized forbidden message when using exceptions

Reported by: tallfred Assigned to:
Milestone: Component: Core framework
Version: 1.0 Keywords:
Cc: Leo Triage Stage: Accepted
Has patch: 1 Needs documentation: 1
Needs tests: 1 Patch needs improvement: 0

Description

When using "raise PermissionDenied?" it would be convenient to provide a more detailed error message such as "raise PermissionDenied?('<h1> Forbidden</h1><p>This blah is owned by another user</p>')".

Attachments

custom-forbidden-msg.diff (0.8 kB) - added by tallfred on 02/25/09 21:12:21.

Change History

02/25/09 21:12:21 changed by tallfred

  • attachment custom-forbidden-msg.diff added.

02/28/09 13:11:14 changed by jacob

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • milestone set to 1.1.

04/01/09 21:46:38 changed by ericholscher

  • owner changed from nobody to ericholscher.
  • needs_docs set to 1.
  • status changed from new to assigned.
  • needs_tests set to 1.

This patch needs tests. It should be pretty simple.

It should probably also be documented.

04/05/09 12:31:23 changed by jacob

  • milestone changed from 1.1 to 1.2.

09/16/09 20:00:30 changed by Leo

  • cc set to Leo.

Eric, I can do a patch & docs for this, but I'm not sure where to document it. PermissionDenied? isn't documented anywhere atm and I'm not sure where the right place would be.

10/08/09 18:46:53 changed by Leo

Actually, even better behavior would be to redirect to a 403.html page just like the 500 and 404 handlers that currently exist. Some more discussion in #5515.

12/12/09 16:34:56 changed by ericholscher

  • owner deleted.
  • status changed from assigned to new.

02/23/10 18:06:55 changed by ubernostrum

  • milestone deleted.

1.2 is feature-frozen, moving this feature request off the milestone.


Add/Change #10360 (allow customized forbidden message when using exceptions)




Change Properties
Action