Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#688 closed defect (fixed)

[patch] Error handlers lack context.

Reported by: wojtek@… Owned by: adrian
Component: Translations Version: 0.90
Severity: critical Keywords: errors handlers 404 500
Cc: django@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Which isn't nice because often one sets various extra_context variables for the views in the middleware. And the 404 view could be using a template which requires some variables from the context (for example name of the currently logged in user).

So it would be nice if page_not_found in django/views/defaults would pass the extra_context variables when rendering the 404.html template.

Attachments (1)

error-handlers.diff (821 bytes) - added by James Wheare <django@…> 9 years ago.
Allows error handlers to benefit from context processors

Download all attachments as: .zip

Change History (19)

comment:1 Changed 10 years ago by adrian

Where would page_not_found get the extra_content? I'm not sure this is possible...

comment:2 Changed 10 years ago by adrian

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

Marking as invalid (see my previous comment).

comment:3 Changed 9 years ago by James Wheare <django@…>

  • Cc django@… added
  • Keywords errors handlers 404 500 added
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Type changed from defect to enhancement

Yep it's possible, you just need to change the context of the view to a RequestContext. Here's a patch, or you can write your own custom view.

Changed 9 years ago by James Wheare <django@…>

Allows error handlers to benefit from context processors

comment:4 Changed 9 years ago by James Wheare <django@…>

  • Summary changed from Default 404 handler uses no context. to [patch] Error handlers lack context

comment:5 Changed 9 years ago by adrian

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

(In [3179]) Fixed #688 -- Changed default 404 and 500 views to use RequestContext

comment:6 Changed 9 years ago by anonymous

  • Component changed from Core framework to Translations
  • priority changed from normal to highest
  • Severity changed from normal to critical
  • Type changed from enhancement to task
  • Version set to 0.9

comment:7 Changed 9 years ago by anonymous

hello!

comment:8 Changed 9 years ago by Wynefrede

  • Summary changed from [patch] Error handlers lack context to smart+question
  • Type changed from task to defect

preved

comment:9 Changed 9 years ago by Leonard

preved

comment:10 Changed 9 years ago by Christean

preved

comment:11 Changed 9 years ago by Katheryne

preved1

comment:12 Changed 9 years ago by Avis

preved2

comment:13 Changed 9 years ago by Constance

preved3

comment:14 Changed 9 years ago by Judith

preved3

comment:15 Changed 9 years ago by Jeffrye

hello mega!

comment:16 Changed 9 years ago by Jeames

hello mega!

comment:17 Changed 9 years ago by Wynefrede

hello mega!

comment:18 Changed 9 years ago by SmileyChris

  • Summary changed from smart+question to [patch] Error handlers lack context.

fixing spammed summary

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