Opened 2 years ago

Closed 22 months ago

Last modified 8 months 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@…> 2 years ago.
20331.diff (5.7 KB) - added by Edwin <django@…> 2 years ago.

Download all attachments as: .zip

Change History (14)

Changed 2 years ago by Edwin <django@…>

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

  • Component changed from Uncategorized to contrib.admin
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Type changed from Uncategorized to Bug

comment:2 Changed 2 years ago by charettes

  • Needs documentation set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.5 to master

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

comment:3 Changed 2 years ago by aaugustin

Yay type checks :-/

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

comment:4 Changed 2 years ago by aaugustin

  • Patch needs improvement set

Changed 2 years ago by Edwin <django@…>

comment:5 Changed 23 months ago by LukaszBalcerzak

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

Patch looks pretty good

comment:6 Changed 23 months ago by aaugustin

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 23 months ago by aaugustin

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

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

comment:8 Changed 22 months ago by timo

  • Cc timograham@… added
  • Patch needs improvement unset

Fixed tests and removed release note.

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

comment:9 Changed 22 months ago by charettes

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:10 Changed 22 months ago by Tim Graham <timograham@…>

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

In d727518ad61beda4d9c2b744c9c05a805aa23ed1:

Fixed #20331 -- Allowed admin actions to serve StreamingHttpResponses

Thanks Edwin.

comment:11 Changed 8 months 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 8 months ago by timo

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