A test for site_branding tag starts to fail with Django 4.0.
It seems to happen as settings.SITE_BRANDING is _("Horizon") and
a translation marker _() is no longer evaluated during rendering.
As a solution, this commit changes the implementation of
site_branding tag to use "simple_tag" method
as django.template.Library.simple_tag() [1] seems to handle
an i18n-ed string properly.
[1] https://docs.djangoproject.com/en/4.0/howto/custom-template-tags/#simple-tags
Closes-Bug: #1980214
Change-Id: I6fdfffbeef2b405da21289d37722e3f068e27fea
test_parse_isotime_filter in test_filters is updated to match
TIME_ZONE=UTC. Previously TIME_ZONE was not set in horizon.test.settings
and the default value America/Chicago was used. Horizon uses UTC as the
default value of TIME_ZONE, so it is better to use UTC for testing too.
horizon settings in openstack_dashboard.settings are moved to
under horizon.
Part of blueprint ini-based-configuration
Change-Id: I9abdbbe0dcefc08ffea61143e3c0a87ed87b2e2a
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
Adding code to allow logo link at the top of the navigation panel
to be configurable.
Close-bug: #1245630
Change-Id: Id5880d3b4fae1ce2d1d8821cc5cf3b2184ea11c9
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
We should use ugettext_lazy to let users in different languages
get correct translation.Though in views or similar places
we can use ugettext with no problems, we should make code
style consistent.
This also fix the issues that the django proxy objects appear on the
launching instance page instead of translated strings. Now the
translated quota strings are handled correctly.
Fixes: bug #1178722
Change-Id: I76f0d31e6546d70e5ece7e86a06f7eefd04861d2
Placing the OpenStack exception class definitions into their
own module inside the openstack_dashboard project allows
more flexibility for deployers and others who might wish
to use the horizon module for non-OpenStack Django projects.
The patch also contains two tiny cleanup items in the
templatetag files.
Change-Id: I8b250804ad07027d40d554ad1e7ee0b5af63d466
There are no longer two separate projects living inside the horizon
repository. There is a single project now with a single setup.py,
single README, etc.
The openstack-dashboard/dashboard django project is now named
"openstack_dashboard" and lives as an example project in the
topmost horizon directory.
The "horizon/horizon" directory has been bumped up a level and now
is directly on the path when the root horizon directory is on
your python path.
Javascript media which the horizon module directly relies upon
now ships in the horizon/static dir rather than
openstack-dashboard/dashboard/static.
All the corresponding setup, installation, build, and env scripts
have been updated accordingly.
Implements blueprint unified-packaging.
Change-Id: Ieed8e3c777432cd046c3e0298869a9428756ab62