Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#20331 closed Bug (fixed)

Django admin action cannot serve StreamingHttpResponse

Reported by: Edwin <django@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: timograham@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I think it's reasonable enough to have an admin action that serves a StreamingHttpResponse.
Patch is attached.

Attachments (2)

admin-action-streaming.patch (1.6 KB) - added by Edwin <django@…> 4 years ago.
20331.diff (5.7 KB) - added by Edwin <django@…> 4 years ago.

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by Edwin <django@…>

comment:1 Changed 4 years ago by Edwin <django@…>

Component: Uncategorizedcontrib.admin
Has patch: set
Type: UncategorizedBug

comment:2 Changed 4 years ago by Simon Charette

Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted
Version: 1.5master

This is a reasonable request indeed. This needs testing and an entry in the release note.

comment:3 Changed 4 years ago by Aymeric Augustin

Yay type checks :-/

The proper solution is to test for HttpResponseBase (a private API that lives in django.http.response).

comment:4 Changed 4 years ago by Aymeric Augustin

Patch needs improvement: set

Changed 4 years ago by Edwin <django@…>

Attachment: 20331.diff added

comment:5 Changed 4 years ago by Łukasz Balcerzak

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

Patch looks pretty good

comment:6 Changed 4 years ago by Aymeric Augustin

I'm committing this, I'll just remove the line from the release notes because it's really a bugfix, and we don't mention them all.

comment:7 Changed 4 years ago by Aymeric Augustin

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Hmm, actually six admin_views tests fail under Python 3 with this patch.

comment:8 Changed 4 years ago by Tim Graham

Cc: timograham@… added
Patch needs improvement: unset

Fixed tests and removed release note.

https://github.com/django/django/pull/1230

comment:9 Changed 4 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin

Ran all admin_views tests on Python 2.7.3 and 3.2.3 with success, marking as RFC.

comment:10 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In d727518ad61beda4d9c2b744c9c05a805aa23ed1:

Fixed #20331 -- Allowed admin actions to serve StreamingHttpResponses

Thanks Edwin.

comment:11 Changed 2 years ago by anentropic

Is there any policy on backporting this fix to older versions...? my project is on 1.5 and I just hit this bug

I'm happy to do the work if it can get merged quickly

comment:12 Changed 2 years ago by Tim Graham

1.5 is receiving only security fixes at this time. See the supported versions policy for details.

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