Commit Graph

12 Commits

Author SHA1 Message Date
Akihiro Motoki b893bcdee3 Make site_branding tag work with Django 4.0
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
2023-10-16 08:40:20 +00:00
Akihiro Motoki 9b99f17100 Define default settings explicitly (horizon)
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
2019-09-12 15:05:56 +09:00
Akihiro Motoki 826720ada3 django2: Replace assignment_tag with simple_tag
https://docs.djangoproject.com/en/2.0/releases/1.9/#assignment-tag

blueprint django2-support
Change-Id: Ib5021a4030fd9bc954365a352bdf4dccd049d28e
2018-02-17 01:36:54 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(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
2018-02-17 01:36:48 +09:00
He Yongli e790ac070e Remove extraneous vim configuration comments
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
2014-05-06 15:30:10 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
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
2014-01-07 12:26:35 +01:00
David Lyle 11aeb1dc93 Allow customization of logo link
Adding code to allow logo link at the top of the navigation panel
to be configurable.

Close-bug: #1245630

Change-Id: Id5880d3b4fae1ce2d1d8821cc5cf3b2184ea11c9
2013-10-30 11:47:07 -06:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Matthias Runge cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02:00
Brooklyn Chen 08e6ed7392 Use ugettext_lazy instead of ugettext.
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
2013-05-18 15:13:54 +08:00
Gabriel Hurley 30b58e2d03 Separate OpenStack exceptions from Horizon exceptions.
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
2012-08-05 12:56:32 -07:00
Gabriel Hurley 052aa55d34 Unifies the project packaging into one set of modules.
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
2012-02-29 00:20:13 -08:00