diff --git a/adjutant_ui/content/email/urls.py b/adjutant_ui/content/email/urls.py index b609d2c..707b4d5 100644 --- a/adjutant_ui/content/email/urls.py +++ b/adjutant_ui/content/email/urls.py @@ -12,12 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from adjutant_ui.content.email import views -urlpatterns = patterns( - '', - url(r'^$', views.EmailView.as_view(), name='index')) +urlpatterns = [ + url(r'^$', views.EmailView.as_view(), name='index') +] diff --git a/adjutant_ui/content/forgot_password/templates/forgot_password/_index.html b/adjutant_ui/content/forgot_password/templates/forgot_password/_index.html index f7df39c..f6c2461 100644 --- a/adjutant_ui/content/forgot_password/templates/forgot_password/_index.html +++ b/adjutant_ui/content/forgot_password/templates/forgot_password/_index.html @@ -1,6 +1,5 @@ {% extends 'forgot_password/_forgot_password_form.html' %} -{% load url from future %} {% load i18n %} {% block pre_login %} diff --git a/adjutant_ui/content/forgot_password/urls.py b/adjutant_ui/content/forgot_password/urls.py index e34eabc..aac0867 100644 --- a/adjutant_ui/content/forgot_password/urls.py +++ b/adjutant_ui/content/forgot_password/urls.py @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns from django.conf.urls import url from adjutant_ui.content.forgot_password import views # NOTE(adriant): These urls are registered in the project_users urls.py file. -urlpatterns = patterns( - '', - url(r'^/?$', views.ForgotPasswordView.as_view(), name='forgot_index'), +urlpatterns = [ + url(r'^$', views.ForgotPasswordView.as_view(), name='forgot_index'), url(r'^sent/?$', views.password_sent_view, name='forgot_sent'), -) +] diff --git a/adjutant_ui/content/project_users/templates/project_users/_invite.html b/adjutant_ui/content/project_users/templates/project_users/_invite.html index 6f503fb..bae6ebd 100644 --- a/adjutant_ui/content/project_users/templates/project_users/_invite.html +++ b/adjutant_ui/content/project_users/templates/project_users/_invite.html @@ -1,6 +1,5 @@ {% extends "horizon/common/_modal_form.html" %} {% load i18n %} -{% load url from future %} {% block modal_id %}invite_user_form{% endblock %} {% block modal-header %}{% trans "Invite User" %}{% endblock %} diff --git a/adjutant_ui/content/project_users/templates/project_users/_update.html b/adjutant_ui/content/project_users/templates/project_users/_update.html index dba59de..667e9ed 100644 --- a/adjutant_ui/content/project_users/templates/project_users/_update.html +++ b/adjutant_ui/content/project_users/templates/project_users/_update.html @@ -1,6 +1,5 @@ {% extends "horizon/common/_modal_form.html" %} {% load i18n %} -{% load url from future %} {% block modal_id %}update_user_form{% endblock %} {% block modal-header %}{% trans "Update User" %}{% endblock %} diff --git a/adjutant_ui/content/project_users/urls.py b/adjutant_ui/content/project_users/urls.py index 1805797..2ebcc06 100644 --- a/adjutant_ui/content/project_users/urls.py +++ b/adjutant_ui/content/project_users/urls.py @@ -12,17 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns from django.conf.urls import url from adjutant_ui.content.project_users import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^invite/$', views.InviteUserView.as_view(), name='invite'), url(r'^(?P[^/]+)/update/$', views.UpdateUserView.as_view(), name='update'), url(r'^$', views.UsersView.as_view(), name='index') -) +] diff --git a/adjutant_ui/content/signup/templates/signup/_index.html b/adjutant_ui/content/signup/templates/signup/_index.html index 447c0d3..6df423b 100644 --- a/adjutant_ui/content/signup/templates/signup/_index.html +++ b/adjutant_ui/content/signup/templates/signup/_index.html @@ -1,6 +1,5 @@ {% extends 'signup/_signup_form.html' %} -{% load url from future %} {% load i18n %} {% block pre_login %} diff --git a/adjutant_ui/content/signup/urls.py b/adjutant_ui/content/signup/urls.py index de0e83d..c8997fb 100644 --- a/adjutant_ui/content/signup/urls.py +++ b/adjutant_ui/content/signup/urls.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns from django.conf.urls import url from adjutant_ui.content.signup import views -urlpatterns = patterns( - '', - url(r'^/?$', views.SignupFormView.as_view(), name='index'), +urlpatterns = [ + url(r'^$', views.SignupFormView.as_view(), name='index'), url(r'^submitted/?$', views.signup_sent_view, name='submitted'), -) +] diff --git a/adjutant_ui/content/tasks/urls.py b/adjutant_ui/content/tasks/urls.py index 005133e..2062af9 100644 --- a/adjutant_ui/content/tasks/urls.py +++ b/adjutant_ui/content/tasks/urls.py @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns + from django.conf.urls import url from adjutant_ui.content.tasks import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^(?P[^/]+)/$', views.TaskDetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/update/$', views.UpdateTaskView.as_view(), name='update'), url(r'^$', views.IndexView.as_view(), name='index'), -) +] diff --git a/adjutant_ui/content/token/urls.py b/adjutant_ui/content/token/urls.py index 7c50def..b373aa7 100644 --- a/adjutant_ui/content/token/urls.py +++ b/adjutant_ui/content/token/urls.py @@ -12,14 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. - -from django.conf.urls import patterns from django.conf.urls import url from adjutant_ui.content.token import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^(?P\w+)/?$', views.submit_token_router, name='token_verify'), -) +] diff --git a/adjutant_ui/enabled/_6001_adjutant_base.py b/adjutant_ui/enabled/_6001_adjutant_base.py index 4c80111..02730e2 100644 --- a/adjutant_ui/enabled/_6001_adjutant_base.py +++ b/adjutant_ui/enabled/_6001_adjutant_base.py @@ -7,3 +7,27 @@ ADD_INSTALLED_APPS = [ 'adjutant_ui', 'overextends', ] + +# TODO(adriant): Remove this and overextends when we drop django<1.11 +from distutils.version import StrictVersion # noqa +import django # noqa + +if StrictVersion(django.__version__) >= StrictVersion("1.9"): + from openstack_dashboard.settings import TEMPLATES as _TEMPLATES + + _builtin = 'overextends.templatetags.overextends_tags' + _template_backend = 'django.template.backends.django.DjangoTemplates' + + for _backend in _TEMPLATES: + if _backend['BACKEND'] == _template_backend: + if 'OPTIONS' in _backend: + try: + if _builtin not in _backend['OPTIONS']['builtins']: + _backend['OPTIONS']['builtins'].append(_builtin) + except KeyError: + _backend['OPTIONS']['builtins'] = [_builtin, ] + else: + _backend['OPTIONS'] = { + 'builtins': [_builtin, ] + } + break diff --git a/requirements.txt b/requirements.txt index 0ffc433..dc0d49c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ # PBR should always appear first pbr>=2.0.0 # Apache-2.0 Babel>=2.3.4 # BSD -Django<1.9,>=1.8 # BSD +Django<1.12,>=1.8 # BSD django-babel>=0.5.1 # BSD django-overextends>=0.4.2