Commit af3519ce by Adam

Merge pull request #7835 from edx/release

Release (DO NOT MERGE)
parents 22d818e0 f740bdbe
......@@ -79,7 +79,7 @@ function() {
var captions = getCaptions();
if (startTimes.length !== captions.length) {
throw new Exception("video caption and start time arrays do not match in length");
console.warn("video caption and start time arrays do not match in length");
}
// if end is null, then it's been set to
......
......@@ -387,8 +387,8 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
Then `about me` field mode should be `edit`
"""
placeholder_value = (
"Tell other edX learners a little about yourself: where you live, what your interests are, "
"why you're taking courses on edX, or what you hope to learn."
"Tell other learners a little about yourself: where you live, what your interests are, "
"why you're taking courses, or what you hope to learn."
)
username, user_id = self.log_in_as_unique_user()
......
......@@ -12,6 +12,8 @@ from django.views.decorators.http import require_http_methods
from edxmako.shortcuts import render_to_response
from student.models import User
from microsite_configuration import microsite
from django.utils.translation import ugettext as _
......@@ -81,6 +83,7 @@ def learner_profile_context(logged_in_username, profile_username, user_is_staff)
'own_profile': (logged_in_username == profile_username),
'country_options': country_options,
'language_options': settings.ALL_LANGUAGES,
'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME),
}
}
......
......@@ -49,6 +49,8 @@ def view_student_survey(user, survey_name, course=None, redirect_url=None, is_re
# just remove that outer key to make the JSON payload simplier
existing_answers = survey.get_answers(user=user).get(user.id, {})
platform_name = microsite.get_value('platform_name', settings.PLATFORM_NAME)
context = {
'existing_data_json': json.dumps(existing_answers),
'postback_url': reverse('submit_answers', args=[survey_name]),
......@@ -58,6 +60,7 @@ def view_student_survey(user, survey_name, course=None, redirect_url=None, is_re
'survey_form': survey.form,
'is_required': is_required,
'mail_to_link': microsite.get_value('email_from_address', settings.CONTACT_EMAIL),
'platform_name': platform_name,
'course': course,
}
......
......@@ -601,9 +601,10 @@ if FEATURES.get('INDIVIDUAL_DUE_DATES'):
# PROFILE IMAGE CONFIG
PROFILE_IMAGE_BACKEND = ENV_TOKENS.get('PROFILE_IMAGE_BACKEND', PROFILE_IMAGE_BACKEND)
PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME', PROFILE_IMAGE_DEFAULT_FILENAME)
PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY)
PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES)
PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES)
if FEATURES['IS_EDX_DOMAIN']:
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/edx-theme/default-profile'
else:
PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME', PROFILE_IMAGE_DEFAULT_FILENAME)
......@@ -46,6 +46,13 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
]
};
var createAccountSettingsPage = function() {
var context = AccountSettingsPage(
FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL, 'edX'
);
return context.accountSettingsView;
};
var requests;
beforeEach(function () {
......@@ -61,10 +68,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
requests = AjaxHelpers.requests(this);
var context = AccountSettingsPage(
FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL
);
var accountSettingsView = context.accountSettingsView;
var accountSettingsView = createAccountSettingsPage();
Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true);
Helpers.expectLoadingErrorIsVisible(accountSettingsView, false);
......@@ -85,10 +89,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
requests = AjaxHelpers.requests(this);
var context = AccountSettingsPage(
FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL
);
var accountSettingsView = context.accountSettingsView;
var accountSettingsView = createAccountSettingsPage();
Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true);
Helpers.expectLoadingErrorIsVisible(accountSettingsView, false);
......@@ -117,10 +118,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
requests = AjaxHelpers.requests(this);
var context = AccountSettingsPage(
FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL
);
var accountSettingsView = context.accountSettingsView;
var accountSettingsView = createAccountSettingsPage();
Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true);
Helpers.expectLoadingErrorIsVisible(accountSettingsView, false);
......@@ -138,10 +136,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
requests = AjaxHelpers.requests(this);
var context = AccountSettingsPage(
FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL
);
var accountSettingsView = context.accountSettingsView;
var accountSettingsView = createAccountSettingsPage();
AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData());
AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData());
......
......@@ -82,7 +82,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
AjaxHelpers.respondWithError(requests, 500);
FieldViewsSpecHelpers.expectMessageContains(
view,
"You must sign out of edX and sign back in before your language changes take effect."
"You must sign out and sign back in before your language changes take effect."
);
});
......
......@@ -40,7 +40,8 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
'profile_image_min_bytes': Helpers.IMAGE_MIN_BYTES,
'profile_image_upload_url': Helpers.IMAGE_UPLOAD_API_URL,
'profile_image_remove_url': Helpers.IMAGE_REMOVE_API_URL,
'default_visibility': 'all_users'
'default_visibility': 'all_users',
'platform_name': 'edX'
});
};
......
......@@ -10,7 +10,7 @@
], function (gettext, $, _, Backbone, Logger, FieldViews, UserAccountModel, UserPreferencesModel,
AccountSettingsFieldViews, AccountSettingsView) {
return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId) {
return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId, platformName) {
var accountSettingsElement = $('.wrapper-account-settings');
......@@ -29,7 +29,9 @@
model: userAccountModel,
title: gettext('Username'),
valueAttribute: 'username',
helpMessage: gettext('The name that identifies you on the edX site. You cannot change your username.')
helpMessage: interpolate_text(
gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), {platform_name: platformName}
)
})
},
{
......@@ -37,7 +39,7 @@
model: userAccountModel,
title: gettext('Full Name'),
valueAttribute: 'name',
helpMessage: gettext('The name that appears on your edX certificates. Other learners never see your full name.')
helpMessage: gettext('The name that appears on your certificates. Other learners never see your full name.')
})
},
{
......@@ -45,7 +47,9 @@
model: userAccountModel,
title: gettext('Email Address'),
valueAttribute: 'email',
helpMessage: gettext('The email address you use to sign in to edX. Communications from edX and your courses are sent to this address.')
helpMessage: interpolate_text(
gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), {platform_name: platformName}
)
})
},
{
......@@ -67,8 +71,9 @@
valueAttribute: 'pref-lang',
required: true,
refreshPageOnSave: true,
helpMessage:
gettext('The language used for the edX site. The site is currently available in a limited number of languages.'),
helpMessage: interpolate_text(
gettext('The language used throughout this site. This site is currently available in a limited number of languages.'), {platform_name: platformName}
),
options: fieldsData.language.options
})
},
......
......@@ -38,10 +38,7 @@
error: function () {
view.showNotificationMessage(
view.indicators.error +
gettext(
'You must sign out of edX and sign back in before your language ' +
'changes take effect.'
)
gettext('You must sign out and sign back in before your language changes take effect.')
);
}
});
......
......@@ -40,7 +40,9 @@
required: true,
editable: 'always',
showMessages: false,
title: gettext('edX learners can see my:'),
title: interpolate_text(
gettext('{platform_name} learners can see my:'), {platform_name: options.platform_name}
),
valueAttribute: "account_privacy",
options: [
['private', gettext('Limited Profile')],
......@@ -101,7 +103,7 @@
editable: editable,
showMessages: false,
title: gettext('About me'),
placeholderValue: gettext("Tell other edX learners a little about yourself: where you live, what your interests are, why you're taking courses on edX, or what you hope to learn."),
placeholderValue: gettext("Tell other learners a little about yourself: where you live, what your interests are, why you're taking courses, or what you hope to learn."),
valueAttribute: "bio",
helpMessage: ''
})
......
<%! import json %>
<%! from django.core.urlresolvers import reverse %>
<%! from django.conf import settings %>
<%! from django.utils.translation import ugettext as _ %>
<%! from microsite_configuration import microsite %>
<!--<%namespace name='static' file='/static_content.html'/>-->
......@@ -40,9 +42,11 @@
var fieldsData = ${ json.dumps(fields) };
var authData = ${ json.dumps(auth) };
var platformName = ${ json.dumps(microsite.get_value('platform_name', settings.PLATFORM_NAME))};
setupAccountSettingsSection(
fieldsData, authData, '${user_accounts_api_url}', '${user_preferences_api_url}', ${user.id}
fieldsData, authData, '${user_accounts_api_url}', '${user_preferences_api_url}', ${user.id},
platformName
);
});
}).call(this, require || RequireJS.require);
......
......@@ -31,7 +31,7 @@
</div>
<p class="instructions">
${_("You can begin your course as soon as you complete the following form. Required fields are marked with an asterisk (*).")}
${_("You can begin your course as soon as you complete the following form. Required fields are marked with an asterisk (*). This information is for the use of {platform_name} only. It will not be linked to your public profile in any way.").format(platform_name=platform_name)}
</p>
% endif
......
......@@ -8,6 +8,8 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from staticfiles.storage import staticfiles_storage
from microsite_configuration import microsite
from student.models import UserProfile
from ..errors import UserNotFound
......@@ -108,7 +110,7 @@ def _get_default_profile_image_urls():
TODO The result of this function should be memoized, but not in tests.
"""
return _get_profile_image_urls(
settings.PROFILE_IMAGE_DEFAULT_FILENAME,
microsite.get_value('PROFILE_IMAGE_DEFAULT_FILENAME', settings.PROFILE_IMAGE_DEFAULT_FILENAME),
staticfiles_storage,
file_extension=settings.PROFILE_IMAGE_DEFAULT_FILE_EXTENSION,
)
......
import os
import signal
import tempfile
import gc
from datetime import datetime
from meliae import scanner
def dump_memory(signum, frame):
"""Dump memory stats for the current process to a temp directory. Uses the meliae output format."""
scanner.dump_all_objects('{}/meliae.{}.{}.dump'.format(tempfile.gettempdir(), datetime.now().isoformat(), os.getpid()))
"""
Dump memory stats for the current process to a temp directory.
Uses the meliae output format.
"""
timestamp = datetime.now().isoformat()
format_str = '{}/meliae.{}.{}.{{}}.dump'.format(
tempfile.gettempdir(),
timestamp,
os.getpid(),
)
scanner.dump_all_objects(format_str.format('pre-gc'))
# force garbarge collection
for gen in xrange(3):
gc.collect(gen)
scanner.dump_all_objects(
format_str.format("gc-gen-{}".format(gen))
)
def install_memory_dumper(dump_signal=signal.SIGPROF):
......
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