summarylogtreecommitdiffstats
path: root/0000-fix-removed-available_attrs.patch
diff options
context:
space:
mode:
Diffstat (limited to '0000-fix-removed-available_attrs.patch')
-rw-r--r--0000-fix-removed-available_attrs.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/0000-fix-removed-available_attrs.patch b/0000-fix-removed-available_attrs.patch
new file mode 100644
index 000000000000..900432a9be92
--- /dev/null
+++ b/0000-fix-removed-available_attrs.patch
@@ -0,0 +1,67 @@
+diff --git a/horizon-19.1.0-old/horizon/decorators.py b/horizon-19.1.0/horizon/decorators.py
+index fa67761..38cca3f 100644
+--- a/horizon-19.1.0-old/horizon/decorators.py
++++ b/horizon-19.1.0/horizon/decorators.py
+@@ -21,13 +21,12 @@ General-purpose decorators for use with Horizon.
+ """
+ import functools
+
+-from django.utils.decorators import available_attrs
+ from django.utils.translation import ugettext_lazy as _
+
+
+ def _current_component(view_func, dashboard=None, panel=None):
+ """Sets the currently-active dashboard and/or panel on the request."""
+- @functools.wraps(view_func, assigned=available_attrs(view_func))
++ @functools.wraps(view_func, assigned=functools.WRAPPER_ASSIGNMENTS)
+ def dec(request, *args, **kwargs):
+ if dashboard:
+ request.horizon['dashboard'] = dashboard
+@@ -46,7 +45,7 @@ def require_auth(view_func):
+ """
+ from horizon.exceptions import NotAuthenticated
+
+- @functools.wraps(view_func, assigned=available_attrs(view_func))
++ @functools.wraps(view_func, assigned=functools.WRAPPER_ASSIGNMENTS)
+ def dec(request, *args, **kwargs):
+ if request.user.is_authenticated:
+ return view_func(request, *args, **kwargs)
+@@ -77,7 +76,7 @@ def require_perms(view_func, required):
+ current_perms = getattr(view_func, '_required_perms', set([]))
+ view_func._required_perms = current_perms | set(required)
+
+- @functools.wraps(view_func, assigned=available_attrs(view_func))
++ @functools.wraps(view_func, assigned=functools.WRAPPER_ASSIGNMENTS)
+ def dec(request, *args, **kwargs):
+ if request.user.is_authenticated:
+ if request.user.has_perms(view_func._required_perms):
+@@ -103,7 +102,7 @@ def require_component_access(view_func, component):
+ """
+ from horizon.exceptions import NotAuthorized
+
+- @functools.wraps(view_func, assigned=available_attrs(view_func))
++ @functools.wraps(view_func, assigned=functools.WRAPPER_ASSIGNMENTS)
+ def dec(request, *args, **kwargs):
+ if not component.can_access({'request': request}):
+ raise NotAuthorized(_("You are not authorized to access %s")
+diff --git a/horizon-19.1.0-old/openstack_dashboard/api/rest/utils.py b/horizon-19.1.0/openstack_dashboard/api/rest/utils.py
+index a9bc3ea..8073ffa 100644
+--- a/horizon-19.1.0-old/openstack_dashboard/api/rest/utils.py
++++ b/horizon-19.1.0/openstack_dashboard/api/rest/utils.py
+@@ -17,7 +17,6 @@ import logging
+
+ from django.conf import settings
+ from django import http
+-from django.utils import decorators
+
+ from oslo_serialization import jsonutils
+
+@@ -104,7 +103,7 @@ def ajax(authenticated=True, data_required=False,
+ def decorator(function, authenticated=authenticated,
+ data_required=data_required):
+ @functools.wraps(function,
+- assigned=decorators.available_attrs(function))
++ assigned=functools.WRAPPER_ASSIGNMENTS)
+ def _wrapped(self, request, *args, **kw):
+ if authenticated and not request.user.is_authenticated:
+ return JSONResponse('not logged in', 401)