Horizon tabbed view returns rendered read-only response

Bug #1595095 reported by Paul Karikh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Timur Sufiev

Bug Description

Horizon tabbed view returns rendered read-only response. It happens because of this string: https://github.com/openstack/horizon/blob/master/horizon/tabs/views.py#L81
And for simple view we do not call additional response: https://github.com/openstack/horizon/blob/master/horizon/views.py#L65

Described tabs view behaviour makes impossible to modify response via middleware. For example, we cannot add messages from middleware despite the fact we can do it if we handing simple view request.

Paul Karikh (pkarikh)
summary: - Horizon tabbed view returns rendered read-only responce
+ Horizon tabbed view returns rendered read-only response
Changed in horizon:
assignee: nobody → Paul Karikh (pkarikh)
Paul Karikh (pkarikh)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/333345

Changed in horizon:
status: New → In Progress
Timur Sufiev (tsufiev-x)
Changed in horizon:
importance: Undecided → Medium
Changed in horizon:
assignee: Paul Karikh (pkarikh) → Timur Sufiev (tsufiev-x)
Changed in horizon:
assignee: Timur Sufiev (tsufiev-x) → Paul Karikh (pkarikh)
Changed in horizon:
assignee: Paul Karikh (pkarikh) → Timur Sufiev (tsufiev-x)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/333345
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=019e5490fbd8475483e9f33a74e127522426bec6
Submitter: Jenkins
Branch: master

commit 019e5490fbd8475483e9f33a74e127522426bec6
Author: Timur Sufiev <email address hidden>
Date: Mon Dec 5 21:05:06 2016 +0300

    Remove additional response.render() for tabs

    Right now TabbedView has additional .render() call. Thus
    get_context_data() for TabbedView returns already rendered response
    with rendered=True flag, which makes it read-only. This blocks
    Profiler middleware in modifying the response. For example, we cannot
    add any messages to response from tabbed view.

    Simple views have no additional rendering. It was done because of
    issues with raising redirect exceptions from tabbed views long
    ago. Looks like now there is no such issues and raising redirects from
    tabbed views is covered with unit tests. To ensure that nothing broke,
    a test with a tab raising Http302 was added - it still redirects to
    the url provided as before.

    Change-Id: I37076abc15008a523f37da0d09b5b041ef77844e
    Closes-Bug: #1595095

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 11.0.0.0b2

This issue was fixed in the openstack/horizon 11.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.