Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#688 closed defect (fixed)

[patch] Error handlers lack context.

Reported by: wojtek@… Owned by: Adrian Holovaty
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: no UI/UX: no

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@…> 19 years ago.
Allows error handlers to benefit from context processors

Download all attachments as: .zip

Change History (19)

comment:1 by Adrian Holovaty, 19 years ago

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

comment:2 by Adrian Holovaty, 19 years ago

Resolution: invalid
Status: newclosed

Marking as invalid (see my previous comment).

comment:3 by James Wheare <django@…>, 19 years ago

Cc: django@… added
Keywords: errors handlers 404 500 added
Resolution: invalid
Status: closedreopened
Type: defectenhancement

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.

by James Wheare <django@…>, 19 years ago

Attachment: error-handlers.diff added

Allows error handlers to benefit from context processors

comment:4 by James Wheare <django@…>, 19 years ago

Summary: Default 404 handler uses no context.[patch] Error handlers lack context

comment:5 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: reopenedclosed

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

comment:6 by anonymous, 18 years ago

Component: Core frameworkTranslations
priority: normalhighest
Severity: normalcritical
Type: enhancementtask
Version: 0.9

comment:7 by anonymous, 18 years ago

hello!

comment:8 by Wynefrede, 18 years ago

Summary: [patch] Error handlers lack contextsmart+question
Type: taskdefect

preved

comment:9 by Leonard, 18 years ago

preved

comment:10 by Christean, 18 years ago

preved

comment:11 by Katheryne, 18 years ago

preved1

comment:12 by Avis, 18 years ago

preved2

comment:13 by Constance, 18 years ago

preved3

comment:14 by Judith, 18 years ago

preved3

comment:15 by Jeffrye, 18 years ago

hello mega!

comment:16 by Jeames, 18 years ago

hello mega!

comment:17 by Wynefrede, 18 years ago

hello mega!

comment:18 by Chris Beaven, 18 years ago

Summary: smart+question[patch] Error handlers lack context.

fixing spammed summary

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