Merge pull request #16568 from edx/pwnage101/set_language_shim_PLAT-1353
Avoid a django breaking change: set_language response code
This commit is contained in:
@@ -142,8 +142,13 @@ define(['backbone',
|
||||
requests,
|
||||
'POST',
|
||||
'/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);
|
||||
FieldViewsSpecHelpers.expectMessageContains(view, 'Your changes have been saved.');
|
||||
|
||||
@@ -157,7 +162,10 @@ define(['backbone',
|
||||
requests,
|
||||
'POST',
|
||||
'/i18n/setlang/',
|
||||
'language=' + data[fieldData.valueAttribute]
|
||||
$.param({
|
||||
language: data[fieldData.valueAttribute],
|
||||
next: window.location.href
|
||||
})
|
||||
);
|
||||
AjaxHelpers.respondWithError(requests, 500);
|
||||
FieldViewsSpecHelpers.expectMessageContains(
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
fieldTemplate: field_dropdown_account_template,
|
||||
saveSucceeded: function() {
|
||||
var data = {
|
||||
language: this.modelValue()
|
||||
language: this.modelValue(),
|
||||
next: window.location.href
|
||||
};
|
||||
|
||||
var view = this;
|
||||
|
||||
Reference in New Issue
Block a user