Commit d8a315f5 by Clinton Blackburn

Updated CSRF cookie name in JS

This was missed when the CSRF_COOKIE_NAME setting was changed. The settings changes have been moved to base.py so that they work across all environments, and we avoid the need to modify JS solely for local usage.
parent 233d71b9
...@@ -399,3 +399,12 @@ REST_FRAMEWORK = { ...@@ -399,3 +399,12 @@ REST_FRAMEWORK = {
# Resolving deprecation warning # Resolving deprecation warning
TEST_RUNNER = 'django.test.runner.DiscoverRunner' TEST_RUNNER = 'django.test.runner.DiscoverRunner'
# COOKIE CONFIGURATION
# The purpose of customizing the cookie names is to avoid conflicts when
# multiple Django services are running behind the same hostname.
# Detailed information at: https://docs.djangoproject.com/en/dev/ref/settings/
SESSION_COOKIE_NAME = 'ecommerce_sessionid'
CSRF_COOKIE_NAME = 'ecommerce_csrftoken'
LANGUAGE_COOKIE_NAME = 'ecommerce_language'
# END COOKIE CONFIGURATION
...@@ -16,15 +16,6 @@ DEBUG = True ...@@ -16,15 +16,6 @@ DEBUG = True
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG
# END DEBUG CONFIGURATION # END DEBUG CONFIGURATION
# COOKIE CONFIGURATION
# The purpose of customizing the cookie names is to avoid conflicts when
# multiple Django services are running behind the same hostname.
# Detailed information at: https://docs.djangoproject.com/en/dev/ref/settings/
SESSION_COOKIE_NAME = 'ecommerce_sessionid'
CSRF_COOKIE_NAME = 'ecommerce_csrftoken'
LANGUAGE_COOKIE_NAME = 'ecommerce_language'
# END COOKIE CONFIGURATION
# EMAIL CONFIGURATION # EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
......
...@@ -12,7 +12,7 @@ $(document).ready(function () { ...@@ -12,7 +12,7 @@ $(document).ready(function () {
$.ajax({ $.ajax({
url: '/api/v2/orders/' + order_number + '/fulfill/', url: '/api/v2/orders/' + order_number + '/fulfill/',
method: 'PUT', method: 'PUT',
headers: {'X-CSRFToken': $.cookie('csrftoken')} headers: {'X-CSRFToken': $.cookie('ecommerce_csrftoken')}
}).success(function (data) { }).success(function (data) {
$('tr[data-order-number=' + order_number + '] .order-status').text(data.status); $('tr[data-order-number=' + order_number + '] .order-status').text(data.status);
addMessage('alert-success', 'icon-check-sign', 'Order ' + order_number + ' has been fulfilled.'); addMessage('alert-success', 'icon-check-sign', 'Order ' + order_number + ' has been fulfilled.');
......
...@@ -16,7 +16,7 @@ $(document).ready(function () { ...@@ -16,7 +16,7 @@ $(document).ready(function () {
url: '/api/v2/refunds/' + refund_id + '/process/', url: '/api/v2/refunds/' + refund_id + '/process/',
data: { action: decision }, data: { action: decision },
method: 'PUT', method: 'PUT',
headers: {'X-CSRFToken': $.cookie('csrftoken')} headers: {'X-CSRFToken': $.cookie('ecommerce_csrftoken')}
}).success(function (data) { }).success(function (data) {
$('tr[data-refund-id=' + refund_id + '] .refund-status').text(data.status); $('tr[data-refund-id=' + refund_id + '] .refund-status').text(data.status);
addMessage('alert-success', 'icon-check-sign', 'Refund #' + refund_id + ' has been processed.'); addMessage('alert-success', 'icon-check-sign', 'Refund #' + refund_id + ' has been processed.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment