Code

#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@…> 15 months ago.
20331.diff (5.7 KB) - added by Edwin <django@…> 15 months ago.

Download all attachments as: .zip

Change History (12)

Changed 15 months ago by Edwin <django@…>

comment:1 Changed 15 months 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 15 months 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 15 months 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 15 months ago by aaugustin

  • Patch needs improvement set

Changed 15 months ago by Edwin <django@…>

comment:5 Changed 14 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 14 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 14 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 14 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 14 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 14 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.