diff options
author | BubaVV <vmarkov@mirantis.com> | 2019-03-18 18:16:03 +0200 |
---|---|---|
committer | BubaVV <vmarkov@mirantis.com> | 2019-03-18 19:03:40 +0200 |
commit | f272d9136d6482b7200833039fb192a97dc84fc6 (patch) | |
tree | 245c09912b7d75931d5ba9b67e0423f645011a86 /horizon/browsers | |
parent | f15a8071bb427a39b7bc0809965b22a502c7d9ea (diff) | |
download | horizon-f272d9136d6482b7200833039fb192a97dc84fc6.tar.gz |
Fix CSRF error on Images dashboard
Proposed patch correctly passes CSRF token to Angular application with
CSRF_COOKIE_HTTPONLY config option turned on. Also, minor release note
warning fixed
Change-Id: Iec90643078dcf3ed4ad786ecc21bfb067a242c6d
Closes-bug: #1819423
Diffstat (limited to 'horizon/browsers')
-rw-r--r-- | horizon/browsers/views.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/horizon/browsers/views.py b/horizon/browsers/views.py index 4d89a9798..383b2de01 100644 --- a/horizon/browsers/views.py +++ b/horizon/browsers/views.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.views import generic @@ -79,6 +80,7 @@ class AngularIndexView(generic.TemplateView): def get_context_data(self, **kwargs): context = super(AngularIndexView, self).get_context_data(**kwargs) context["title"] = self.title + context["csrf_http"] = getattr(settings, 'CSRF_COOKIE_HTTPONLY', False) if self.page_title is None: context["page_title"] = self.title else: @@ -100,6 +102,7 @@ class AngularDetailsView(generic.TemplateView): title = _("Horizon") context["title"] = title context["page_title"] = title + context["csrf_http"] = getattr(settings, 'CSRF_COOKIE_HTTPONLY', False) # set default dashboard and panel dashboard = horizon.get_default_dashboard() self.request.horizon['dashboard'] = dashboard |