Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12207 (new)

Opened 8 years ago

Last modified 7 years ago

render_response and render_response_admin fail if given an HttpResponse — at Initial Version

Reported by: drussell-x Owned by: web-team@…
Priority: minor Milestone: Unscheduled
Component: Web Version: 5.0.1
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Returning an HttpResponse? from the decorated function causes the decorator to bail out as it has already got a response.

https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/decorators.py#L490

This produces undesired behaviour in that (for example) none of the additional admin context is present when the template is rendered, causing it to render incorrectly.

I think that really the adding of context should be separated from the render_response decorator or I think that possibly a better way to add this context is with a template tag rather than a decorator as this can then be used only where required and doesn't have to be added to every admin function for maximum DRYness.

Change History (0)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.69561 sec.)

We're Hiring!