Clean unused code for `supports_tenants`

It seems that the `supports_tenants` attr is unused now,
the patch clean up some code related to `supports_tenants`
so that the code can be more readable for devs:)

Closes-Bug: 1417841
Change-Id: Ia3def66b34bf91a4a4e2d7bcb61c5f3be1d16abb
This commit is contained in:
lawrancejing 2015-02-02 21:00:41 +08:00 committed by jing.liuqing
parent 1bff6943a7
commit fed29ee138
4 changed files with 30 additions and 42 deletions

View File

@ -243,7 +243,6 @@ process::
# ObjectStorePanels
panels = (BasePanels, NetworkPanels, ObjectStorePanels)
default_panel = 'overview'
supports_tenants = True
...
horizon.register(Project)

View File

@ -412,13 +412,6 @@ class Dashboard(Registry, HorizonComponent):
to control whether or not this dashboard should appear in
automatically-generated navigation. Default: ``True``.
.. attribute:: supports_tenants
Optional boolean that indicates whether or not this dashboard includes
support for projects/tenants. If set to ``True`` this dashboard's
navigation will include a UI element that allows the user to select
project/tenant. Default: ``False``.
.. attribute:: public
Boolean value to determine whether this dashboard can be viewed
@ -432,7 +425,6 @@ class Dashboard(Registry, HorizonComponent):
panels = []
default_panel = None
nav = True
supports_tenants = False
public = False
def __repr__(self):

View File

@ -4,7 +4,6 @@
<dl class="nav_accordion">
{% for dashboard, panel_info in components %}
{% if user|has_permissions:dashboard %}
{% if dashboard.supports_tenants and request.user.authorized_tenants or not dashboard.supports_tenants %}
<dt {% if current.slug == dashboard.slug %}class="active"{% endif %}>
{{ dashboard.name }}
<span class="glyphicon pull-right"></span>
@ -37,6 +36,5 @@
{% endfor %}
</dd>
{% endif %}
{% endif %}
{% endfor %}
</dl>

View File

@ -83,7 +83,6 @@ class Project(horizon.Dashboard):
DatabasePanels,
DataProcessingPanels,)
default_panel = 'overview'
supports_tenants = True
horizon.register(Project)