Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15010 closed (fixed)

TemplateResponse: add current_app parameter for RequestContext

Reported by: acdha Owned by: acdha
Component: Template system Version: master
Severity: Keywords: blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

#15008 converts admin to return TemplateResponse instances. The patch is complicated by the fact that we still have to create RequestContext instances manually to set current_app in many places. This branch / patch changes TemplateResponse to pass through the current_app value when creating a RequestContext instance dynamically:

https://github.com/acdha/django/compare/master...template-response-current_app
https://github.com/acdha/django/compare/master...template-response-current_app.patch

Attachments (3)

template-response-current_app.2.txt (12.7 KB) - added by acdha 4 years ago.
template-response-current_app.txt (12.7 KB) - added by acdha 4 years ago.
template-response-current_app.patch (12.7 KB) - added by acdha 4 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 years ago by russellm

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Good catch. For the record, the same problem exists with the render() shortcut. Marking needs improvement so that we can roll that fix into the same commit.

Also requires docs.

Since this is a functional flaw in a 1.3 feature, this should be a 1.3 blocker.

comment:2 follow-up: Changed 4 years ago by acdha

  • Owner changed from nobody to acdha

Added the render shortcut and some basic documentation here, which is the commit used for the updated patch:

https://github.com/acdha/django/commit/d1024ace8965230d5eac7d2a7a8cefeeefc3b36d

Do you have any suggestions for further improvements?

Also, at this point, I should assume that it's safe to update #15008 to assume that this change will be included, right?

Changed 4 years ago by acdha

Changed 4 years ago by acdha

Changed 4 years ago by acdha

comment:3 Changed 4 years ago by acdha

  • Status changed from new to assigned

Updated patch and corrected the filename

comment:4 in reply to: ↑ 2 Changed 4 years ago by jezdez

Replying to acdha:

Added the render shortcut and some basic documentation here, which is the commit used for the updated patch:

Also, at this point, I should assume that it's safe to update #15008 to assume that this change will be included, right?

Yup.

comment:5 Changed 4 years ago by russellm

  • Keywords blocker added

comment:6 Changed 4 years ago by jezdez

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

(In [15153]) Fixed #15010 -- Added current_app parameter to close gap between TemplateResponse and render method. Thanks, acdha.

comment:7 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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