diff --git a/common/test/acceptance/tests/lms/test_account_settings.py b/common/test/acceptance/tests/lms/test_account_settings.py index e76e8179fb..9c720f3d7c 100644 --- a/common/test/acceptance/tests/lms/test_account_settings.py +++ b/common/test/acceptance/tests/lms/test_account_settings.py @@ -286,7 +286,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest): u'email', u'Email Address', email, - u'@', + u'test@example.com' + XSS_INJECTION, [u'me@here.com', u'you@there.com'], success_message='Click the link in the message to update your email address.', assert_after_reload=False diff --git a/lms/static/js/student_account/models/user_account_model.js b/lms/static/js/student_account/models/user_account_model.js index d2e1791460..fbd040a44f 100644 --- a/lms/static/js/student_account/models/user_account_model.js +++ b/lms/static/js/student_account/models/user_account_model.js @@ -34,23 +34,27 @@ // Currently when a non-staff user A access user B's profile, the only way to tell whether user B's // profile is public is to check if the api has returned fields other than the default public fields // specified in settings.ACCOUNT_VISIBILITY_CONFIGURATION. - var responseKeys = _.filter(_.keys(response), function (key) {return key !== 'default_public_account_fields'}); - response.profile_is_public = _.size(_.difference(responseKeys, response.default_public_account_fields)) > 0; - - return response; + var responseKeys = _.filter(_.keys(response), function (key) { + return key !== 'default_public_account_fields'; + }); + + var isPublic = _.size(_.difference(responseKeys, response.default_public_account_fields)) > 0; + response.profile_is_public = isPublic; + return response; }, hasProfileImage: function () { var profile_image = this.get('profile_image'); - return (_.isObject(profile_image) && profile_image['has_image'] === true); + return (_.isObject(profile_image) && profile_image.has_image === true); }, profileImageUrl: function () { - return this.get('profile_image')['image_url_large']; + return this.get('profile_image').image_url_large; }, isAboveMinimumAge: function() { - var isBirthDefined = !(_.isUndefined(this.get('year_of_birth')) || _.isNull(this.get('year_of_birth'))); + var yearOfBirth = this.get('year_of_birth'); + var isBirthDefined = !(_.isUndefined(yearOfBirth) || _.isNull(yearOfBirth)); return isBirthDefined && !(this.get("requires_parental_consent")); } }); diff --git a/lms/templates/dashboard/_dashboard_third_party_error.html b/lms/templates/dashboard/_dashboard_third_party_error.html index a7958b9481..8903056380 100644 --- a/lms/templates/dashboard/_dashboard_third_party_error.html +++ b/lms/templates/dashboard/_dashboard_third_party_error.html @@ -1,3 +1,5 @@ +<%page expression_filter="h"/> + <%! from django.utils.translation import ugettext as _ %>