Unverified Commit 1e09a548 by Troy Sankey Committed by GitHub

Merge pull request #16568 from edx/pwnage101/set_language_shim_PLAT-1353

Avoid a django breaking change: set_language response code
parents d9420fc0 bff8c082
...@@ -142,8 +142,13 @@ define(['backbone', ...@@ -142,8 +142,13 @@ define(['backbone',
requests, requests,
'POST', 'POST',
'/i18n/setlang/', '/i18n/setlang/',
'language=' + data[fieldData.valueAttribute] $.param({
language: data[fieldData.valueAttribute],
next: window.location.href
})
); );
// Django will actually respond with a 302 redirect, but that would cause a page load during these
// unittests. 204 should work fine for testing.
AjaxHelpers.respondWithNoContent(requests); AjaxHelpers.respondWithNoContent(requests);
FieldViewsSpecHelpers.expectMessageContains(view, 'Your changes have been saved.'); FieldViewsSpecHelpers.expectMessageContains(view, 'Your changes have been saved.');
...@@ -157,7 +162,10 @@ define(['backbone', ...@@ -157,7 +162,10 @@ define(['backbone',
requests, requests,
'POST', 'POST',
'/i18n/setlang/', '/i18n/setlang/',
'language=' + data[fieldData.valueAttribute] $.param({
language: data[fieldData.valueAttribute],
next: window.location.href
})
); );
AjaxHelpers.respondWithError(requests, 500); AjaxHelpers.respondWithError(requests, 500);
FieldViewsSpecHelpers.expectMessageContains( FieldViewsSpecHelpers.expectMessageContains(
......
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
fieldTemplate: field_dropdown_account_template, fieldTemplate: field_dropdown_account_template,
saveSucceeded: function() { saveSucceeded: function() {
var data = { var data = {
language: this.modelValue() language: this.modelValue(),
next: window.location.href
}; };
var view = this; var view = this;
......
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