Relocating panel to a different dashboard via Pluggable Settings causes TemplateDoesNotExist

Bug #1533910 reported by Alan Fung on 2016-01-14
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
High
Vishal Manchanda

Bug Description

Steps to reproduce:

1. Move users panel to be under admin dashboard by modifying _3030_identity_users_panel.py
2. Set PANEL_GROUP = 'admin'
3. Set PANEL_DASHBOARD = 'admin'

Expected:

1. Users panel to be under Admin panel group in the navigation.
2. Users panel to load.

Actual:

1. Users panel under Admin panel group in the navigation.
2. Users panel would generate a TemplateDoesNotExist

Observations:

This issue is due to Dashboard.register populates the panel_template_dirs for horizon template loader with the key "admin/users" for the Identity Users panel. However, TemplateLoader.get_template_sources would still look up "identity/users" for templates by convention (i.e. template "identity/users/index.html")..

Alan Fung (alanfung) on 2016-01-14
description: updated
Alan Fung (alanfung) wrote :

As a suggestion to address this, we can modify Dashboard.register to generate the key from panel_dir (directory of the panel) instead of appending cls.slug and panel.slug.

Both approaches to generate the key make assumptions about the file layout, but the suggested is less fallible and compatible with (what I presume) to be a function of Pluggable Settings, which is the flexibility of moving panel to any dashboard.

Changed in horizon:
status: New → Confirmed
importance: Undecided → High
milestone: none → next
Alan Fung (alanfung) on 2016-01-22
Changed in horizon:
assignee: nobody → Alan Fung (alanfung)

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

Changed in horizon:
status: Confirmed → In Progress
ST9527 (st9527-cs229) wrote :

Even when you fixed it, find the template,it will still crash when a panel contains tables!

When I move 'project/instances' under 'identity',it reports error like this:

TemplateSyntaxError

u'instances' is not a registered namespace inside 'horizon:project'

Changed in horizon:
assignee: Alan Fung (alanfung) → Richard Jones (r1chardj0n3s)

Change abandoned by Rob Cresswell (<email address hidden>) on branch: master
Review: https://review.openstack.org/271201
Reason: Abandoned due to inactivity. Please feel free to restore if you wish to work on it.

amber (amber1987) on 2017-11-28
description: updated
Akihiro Motoki (amotoki) wrote :

Clearing the assignee due to long inactivity.

Changed in horizon:
assignee: Richard Jones (r1chardj0n3s) → nobody
Ivan Kolodyazhny (e0ne) on 2019-05-22
Changed in horizon:
status: In Progress → Confirmed

Fix proposed to branch: master
Review: https://review.opendev.org/666805

Changed in horizon:
assignee: nobody → Vishal Manchanda (vishalmanchanda)
status: Confirmed → In Progress

Change abandoned by Vishal Manchanda (<email address hidden>) on branch: master
Review: https://review.opendev.org/666805
Reason: abandoning this patch and restore original patch https://review.opendev.org/#/c/271201/

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

Other bug subscribers