From e2109bd4e336c2e6d64ab1ad484df2adc7dc126c Mon Sep 17 00:00:00 2001 From: Dean Montgomery Date: Wed, 13 Sep 2017 15:51:03 +0100 Subject: [PATCH] force setting csrftoken on first run page also bump version --- CHANGELOG.md | 10 ++++++++-- VERSION | 2 +- ansible/env_vars/base.yml | 2 +- scripts/ansible_install.sh | 2 +- site_config/views.py | 3 +++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99271ecc..c3117093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,19 @@ All notable changes to this project will be documented in this file. ## [Unreleased] -## [v.2.5.2] +## [v2.5.3] + +### Fixed + + - Fix csrftoken missing on first run setup + +## [v2.5.2] ### Fixed - Fix bug in first run page -## [v.2.5.1] +## [v2.5.1] ### Fixed diff --git a/VERSION b/VERSION index f225a78a..aedc15bb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.2 +2.5.3 diff --git a/ansible/env_vars/base.yml b/ansible/env_vars/base.yml index 8d7c65ac..4b83fc4c 100644 --- a/ansible/env_vars/base.yml +++ b/ansible/env_vars/base.yml @@ -1,7 +1,7 @@ --- git_repo: https://github.com/monty5811/apostello.git -git_version: v2.5.2 +git_version: v2.5.3 project_name: apostello application_name: apostello diff --git a/scripts/ansible_install.sh b/scripts/ansible_install.sh index 144a8acf..b8f17525 100755 --- a/scripts/ansible_install.sh +++ b/scripts/ansible_install.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e # setup some constants -AP_VER=v2.5.2 +AP_VER=v2.5.3 REPO_URL=https://github.com/monty5811/apostello.git HOME_DIR=/home/apostello CUSTOM_VARS_FILE=$HOME_DIR/custom_vars.yml diff --git a/site_config/views.py b/site_config/views.py index 12df8fb8..ca414d3e 100644 --- a/site_config/views.py +++ b/site_config/views.py @@ -7,6 +7,8 @@ from django.core.cache import cache from django.http import JsonResponse from django.shortcuts import redirect +from django.utils.decorators import method_decorator +from django.views.decorators.csrf import ensure_csrf_cookie from django.views.generic import TemplateView, View from rest_framework.parsers import JSONParser from twilio.base.exceptions import TwilioException @@ -16,6 +18,7 @@ EnvVarSetting = namedtuple('EnvVarSetting', ['env_var_name', 'info', 'val']) +@method_decorator(ensure_csrf_cookie, name='dispatch') class FirstRunView(TemplateView): """View to make initial run experience easier.""" template_name = 'apostello/first_run.html'