Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly render context in Django error views #534

Open
matthew-li opened this issue May 10, 2023 · 0 comments
Open

Properly render context in Django error views #534

matthew-li opened this issue May 10, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@matthew-li
Copy link
Collaborator

When a view returns one of the status codes (400, 403, 404, 500), a default Django error view is invoked, but these views (with the exception of 404) do not include context variables provided by TEMPLATES['OPTIONS']['context_processors'].

As a result, the names of the portal and program (provided by the context processor portal_and_program_names) are not included in the title or at the top of the page (see coldfront.templates.XXX.html).

Option 1: Customize the views to include at least these pieces of context. This would likely involve copying a lot of the original view code.
Option 2: Pre-generate the XXX.html files (e.g., in Ansible) to have the name hard-coded. However, these templates extend the base template and load static content, so this may not be feasible.

Note that DEBUG must be False to test this.

@matthew-li matthew-li added the bug Something isn't working label May 10, 2023
@tyfong-lbl tyfong-lbl self-assigned this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants