diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 8090ad5987ba..6c156db19179 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -2186,10 +2186,12 @@ def test_how_it_works(self): self._test_page("/howitworks") def test_signup(self): - self._test_page("/signup") + # deprecated signup url redirects to LMS register. + self._test_page("/signup", 301) def test_login(self): - self._test_page("/signin") + # deprecated signin url redirects to LMS login. + self._test_page("/signin", 302) def test_logout(self): # Logout redirects. @@ -2202,36 +2204,6 @@ def test_accessibility(self): self._test_page('/accessibility') -class SigninPageTestCase(TestCase): - """ - Tests that the CSRF token is directly included in the signin form. This is - important to make sure that the script is functional independently of any - other script. - """ - - def test_csrf_token_is_present_in_form(self): - # Expected html: - #
- response = self.client.get("/signin") - csrf_token = response.cookies.get("csrftoken") - form = lxml.html.fromstring(response.content).get_element_by_id("login_form") - csrf_input_field = form.find(".//input[@name='csrfmiddlewaretoken']") - - self.assertIsNotNone(csrf_token) - self.assertIsNotNone(csrf_token.value) - self.assertIsNotNone(csrf_input_field) - - self.assertTrue(_compare_salted_tokens(csrf_token.value, csrf_input_field.attrib["value"])) - - def _create_course(test, course_key, course_data): """ Creates a course via an AJAX request and verifies the URL returned in the response. diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py index 6c5793fa665c..4d25aac60c6f 100644 --- a/cms/djangoapps/contentstore/tests/tests.py +++ b/cms/djangoapps/contentstore/tests/tests.py @@ -7,19 +7,14 @@ import time import mock -import pytest from contentstore.tests.test_course_settings import CourseTestCase from contentstore.tests.utils import AjaxEnabledTestClient, parse_json, registration, user from ddt import data, ddt, unpack from django.conf import settings -from django.contrib.auth.models import User from django.core.cache import cache -from django.test import TestCase from django.test.utils import override_settings from django.urls import reverse -from freezegun import freeze_time from pytz import UTC -from six.moves import range from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory @@ -87,36 +82,7 @@ def activate_user(self, email): self.assertTrue(user(email).is_active) -@pytest.mark.django_db -def test_create_account_email_already_exists(django_db_use_migrations): - """ - This is tricky. Django's user model doesn't have a constraint on - unique email addresses, but we *add* that constraint during the - migration process: - see common/djangoapps/student/migrations/0004_add_email_index.py - - The behavior we *want* is for this account creation request - to fail, due to this uniqueness constraint, but the request will - succeed if the migrations have not run. - - django_db_use_migration is a pytest fixture that tells us if - migrations have been run. Since pytest fixtures don't play nice - with TestCase objects this is a function and doesn't get to use - assertRaises. - """ - if django_db_use_migrations: - email = 'a@b.com' - pw = 'xyz' - username = 'testuser' - User.objects.create_user(username, email, pw) - - # Hack to use the _create_account shortcut - case = ContentStoreTestCase() - resp = case._create_account("abcdef", email, "password") # pylint: disable=protected-access - - assert resp.status_code == 400, 'Migrations are run, but creating an account with duplicate email succeeded!' - - +@ddt class AuthTestCase(ContentStoreTestCase): """Check that various permissions-related things work""" @@ -138,114 +104,6 @@ def check_page_get(self, url, expected): self.assertEqual(resp.status_code, expected) return resp - def test_public_pages_load(self): - """Make sure pages that don't require login load without error.""" - pages = ( - reverse('login'), - reverse('signup'), - ) - for page in pages: - print(u"Checking '{0}'".format(page)) - self.check_page_get(page, 200) - - def test_create_account_errors(self): - # No post data -- should fail - registration_url = reverse('user_api_registration') - resp = self.client.post(registration_url, {}) - self.assertEqual(resp.status_code, 400) - - def test_create_account(self): - self.create_account(self.username, self.email, self.pw) - self.activate_user(self.email) - - def test_create_account_username_already_exists(self): - User.objects.create_user(self.username, self.email, self.pw) - resp = self._create_account(self.username, "abc@def.com", "password") - # we have a constraint on unique usernames, so this should fail - self.assertEqual(resp.status_code, 409) - - def test_create_account_pw_already_exists(self): - User.objects.create_user(self.username, self.email, self.pw) - resp = self._create_account("abcdef", "abc@def.com", self.pw) - # we can have two users with the same password, so this should succeed - self.assertEqual(resp.status_code, 200) - - def test_login(self): - self.create_account(self.username, self.email, self.pw) - - # Not activated yet. Login should fail. - self._login(self.email, self.pw) - - self.activate_user(self.email) - - # Now login should work - self.login(self.email, self.pw) - - def test_login_ratelimited(self): - # try logging in 30 times, the default limit in the number of failed - # login attempts in one 5 minute period before the rate gets limited - for i in range(30): - resp = self._login(self.email, 'wrong_password{0}'.format(i)) - self.assertEqual(resp.status_code, 403) - resp = self._login(self.email, 'wrong_password') - self.assertContains(resp, 'Too many failed login attempts.', status_code=403) - - @override_settings(MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED=3) - @override_settings(MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS=2) - def test_excessive_login_failures(self): - # try logging in 3 times, the account should get locked for 3 seconds - # note we want to keep the lockout time short, so we don't slow down the tests - - with mock.patch.dict('django.conf.settings.FEATURES', {'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': True}): - self.create_account(self.username, self.email, self.pw) - self.activate_user(self.email) - - for i in range(3): - resp = self._login(self.email, 'wrong_password{0}'.format(i)) - self.assertContains( - resp, - 'Email or password is incorrect.', - status_code=403, - ) - - # now the account should be locked - - resp = self._login(self.email, 'wrong_password') - self.assertContains( - resp, - 'This account has been temporarily locked due to excessive login failures.', - status_code=403, - ) - - with freeze_time('2100-01-01'): - self.login(self.email, self.pw) - - # make sure the failed attempt counter gets reset on successful login - resp = self._login(self.email, 'wrong_password') - self.assertContains( - resp, - 'Email or password is incorrect.', - status_code=403, - ) - - # account should not be locked out after just one attempt - self.login(self.email, self.pw) - - # do one more login when there is no bad login counter row at all in the database to - # test the "ObjectNotFound" case - self.login(self.email, self.pw) - - def test_login_link_on_activation_age(self): - self.create_account(self.username, self.email, self.pw) - # we want to test the rendering of the activation page when the user isn't logged in - self.client.logout() - resp = self._activate_user(self.email) - - # check the the HTML has links to the right login page. Note that this is merely a content - # check and thus could be fragile should the wording change on this page - expected = 'You can now sign in.' - self.assertContains(resp, expected) - def test_private_pages_auth(self): """Make sure pages that do require login work.""" auth_pages = ( @@ -259,7 +117,8 @@ def test_private_pages_auth(self): ) # need an activated user - self.test_create_account() + self.create_account(self.username, self.email, self.pw) + self.activate_user(self.email) # Create a new session self.client = AjaxEnabledTestClient() @@ -278,14 +137,6 @@ def test_private_pages_auth(self): print(u"Checking '{0}'".format(page)) self.check_page_get(page, expected=200) - def test_index_auth(self): - - # not logged in. Should return a redirect. - resp = self.client.get_html('/home/') - self.assertEqual(resp.status_code, 302) - - # Logged in should work. - @override_settings(SESSION_INACTIVITY_TIMEOUT_IN_SECONDS=1) def test_inactive_session_timeout(self): """ @@ -308,37 +159,30 @@ def test_inactive_session_timeout(self): resp = self.client.get_html(course_url) # re-request, and we should get a redirect to login page - self.assertRedirects(resp, settings.LOGIN_URL + '?next=/home/') + self.assertRedirects(resp, settings.LOGIN_URL + '?next=/home/', target_status_code=302) - @mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": False}) - def test_signup_button_index_page(self): + @data( + (True, 'assertContains'), + (False, 'assertNotContains')) + @unpack + def test_signin_and_signup_buttons_index_page(self, allow_account_creation, assertion_method_name): """ Navigate to the home page and check the Sign Up button is hidden when ALLOW_PUBLIC_ACCOUNT_CREATION flag - is turned off - """ - response = self.client.get(reverse('homepage')) - self.assertNotContains(response, 'Sign Up') - - @mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": False}) - def test_signup_button_login_page(self): - """ - Navigate to the login page and check the Sign Up button is hidden when ALLOW_PUBLIC_ACCOUNT_CREATION flag - is turned off - """ - response = self.client.get(reverse('login')) - self.assertNotContains(response, 'Sign Up') - - @mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": False}) - def test_signup_link_login_page(self): - """ - Navigate to the login page and check the Sign Up link is hidden when ALLOW_PUBLIC_ACCOUNT_CREATION flag - is turned off + is turned off, and not when it is turned on. The Sign In button should always appear. """ - response = self.client.get(reverse('login')) - self.assertNotContains( - response, - 'Don't have a Studio Account? Sign up!' - ) + with mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": allow_account_creation}): + response = self.client.get(reverse('homepage')) + assertion_method = getattr(self, assertion_method_name) + assertion_method( + response, + u'Sign Up'.format( # pylint: disable=line-too-long + settings.LMS_ROOT_URL + ) + ) + self.assertContains( + response, + u'Sign In' # pylint: disable=line-too-long + ) class ForumTestCase(CourseTestCase): diff --git a/cms/djangoapps/contentstore/views/public.py b/cms/djangoapps/contentstore/views/public.py index e9d5603cbb74..f0c81023de6d 100644 --- a/cms/djangoapps/contentstore/views/public.py +++ b/cms/djangoapps/contentstore/views/public.py @@ -5,48 +5,25 @@ from django.conf import settings from django.shortcuts import redirect -from django.template.context_processors import csrf from django.utils.http import urlquote_plus -from django.views.decorators.clickjacking import xframe_options_deny -from django.views.decorators.csrf import ensure_csrf_cookie from waffle.decorators import waffle_switch from contentstore.config import waffle from edxmako.shortcuts import render_to_response -from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers -__all__ = ['signup', 'login_page', 'login_redirect_to_lms', 'howitworks', 'accessibility'] +__all__ = ['register_redirect_to_lms', 'login_redirect_to_lms', 'howitworks', 'accessibility'] -@ensure_csrf_cookie -@xframe_options_deny -def signup(request): +def register_redirect_to_lms(request): """ - Display the signup form. + This view redirects to the LMS register view. It is used to temporarily keep the old + Studio signup url alive. """ - csrf_token = csrf(request)['csrf_token'] - if request.user.is_authenticated: - return redirect('/course/') - - return render_to_response('register.html', {'csrf': csrf_token}) - - -@ensure_csrf_cookie -@xframe_options_deny -def login_page(request): - """ - Display the login form. - """ - csrf_token = csrf(request)['csrf_token'] - - return render_to_response( - 'login.html', - { - 'csrf': csrf_token, - 'forgot_password_link': "//{base}/login#forgot-password-modal".format(base=settings.LMS_BASE), - 'platform_name': configuration_helpers.get_value('platform_name', settings.PLATFORM_NAME), - } + register_url = '{register_url}{params}'.format( + register_url=settings.FRONTEND_REGISTER_URL, + params=_build_next_param(request), ) + return redirect(register_url, permanent=True) def login_redirect_to_lms(request): @@ -54,15 +31,25 @@ def login_redirect_to_lms(request): This view redirects to the LMS login view. It is used for Django's LOGIN_URL setting, which is where unauthenticated requests to protected endpoints are redirected. """ - next_url = request.GET.get('next') - absolute_next_url = request.build_absolute_uri(next_url) - login_url = '{base_url}/login{params}'.format( - base_url=settings.LMS_ROOT_URL, - params='?next=' + urlquote_plus(absolute_next_url) if next_url else '', + login_url = '{login_url}{params}'.format( + login_url=settings.FRONTEND_LOGIN_URL, + params=_build_next_param(request), ) return redirect(login_url) +def _build_next_param(request): + """ Returns the next param to be used with login or register. """ + next_url = request.GET.get('next') + next_url = next_url if next_url else settings.LOGIN_REDIRECT_URL + if next_url: + # Warning: do not use `build_absolute_uri` when `next_url` is empty because `build_absolute_uri` would + # build use the login url for the next url, which would cause a login redirect loop. + absolute_next_url = request.build_absolute_uri(next_url) + return '?next=' + urlquote_plus(absolute_next_url) + return '' + + def howitworks(request): "Proxy view" if request.user.is_authenticated: diff --git a/cms/djangoapps/maintenance/tests.py b/cms/djangoapps/maintenance/tests.py index 4135de466e91..d6719adbd679 100644 --- a/cms/djangoapps/maintenance/tests.py +++ b/cms/djangoapps/maintenance/tests.py @@ -92,11 +92,12 @@ def test_require_login(self, url): # Expect a redirect to the login page redirect_url = '{login_url}?next={original_url}'.format( - login_url=reverse('login'), + login_url=settings.LOGIN_URL, original_url=url, ) - self.assertRedirects(response, redirect_url) + # Studio login redirects to LMS login + self.assertRedirects(response, redirect_url, target_status_code=302) @ddt.data(*MAINTENANCE_URLS) def test_global_staff_access(self, url): diff --git a/cms/envs/common.py b/cms/envs/common.py index 1ef5653aeaaf..cd622cceb09d 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -475,8 +475,6 @@ ############################################################################## EDX_ROOT_URL = '' -LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/home/' -LOGIN_URL = reverse_lazy('login_redirect_to_lms') # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = [ @@ -496,13 +494,21 @@ LMS_BASE = 'localhost:18000' LMS_ROOT_URL = "https://localhost:18000" LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL + +LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/home/' +# TODO: Determine if LOGIN_URL could be set to the FRONTEND_LOGIN_URL value instead. +LOGIN_URL = reverse_lazy('login_redirect_to_lms') +FRONTEND_LOGIN_URL = lambda settings: settings.LMS_ROOT_URL + '/login' +derived('FRONTEND_LOGIN_URL') +FRONTEND_LOGOUT_URL = lambda settings: settings.LMS_ROOT_URL + '/logout' +derived('FRONTEND_LOGOUT_URL') +FRONTEND_REGISTER_URL = lambda settings: settings.LMS_ROOT_URL + '/register' +derived('FRONTEND_REGISTER_URL') + LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/" ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = {} -FRONTEND_LOGIN_URL = LOGIN_URL -FRONTEND_LOGOUT_URL = lambda settings: settings.LMS_ROOT_URL + '/logout' -derived('FRONTEND_LOGOUT_URL') # Public domain name of Studio (should be resolvable from the end-user's browser) CMS_BASE = 'localhost:18010' @@ -2122,3 +2128,44 @@ 'country': 'hidden', } EDXAPP_PARSE_KEYS = {} + +###################### DEPRECATED URLS ########################## + +# .. toggle_name: DISABLE_DEPRECATED_SIGNIN_URL +# .. toggle_implementation: DjangoSetting +# .. toggle_default: False +# .. toggle_description: Toggle for removing the deprecated /signin url. +# .. toggle_category: n/a +# .. toggle_use_cases: incremental_release +# .. toggle_creation_date: 2019-12-02 +# .. toggle_expiration_date: 2020-06-01 +# .. toggle_warnings: This url can be removed once it no longer has any real traffic. +# .. toggle_tickets: ARCH-1253 +# .. toggle_status: supported +DISABLE_DEPRECATED_SIGNIN_URL = False + +# .. toggle_name: DISABLE_DEPRECATED_SIGNUP_URL +# .. toggle_implementation: DjangoSetting +# .. toggle_default: False +# .. toggle_description: Toggle for removing the deprecated /signup url. +# .. toggle_category: n/a +# .. toggle_use_cases: incremental_release +# .. toggle_creation_date: 2019-12-02 +# .. toggle_expiration_date: 2020-06-01 +# .. toggle_warnings: This url can be removed once it no longer has any real traffic. +# .. toggle_tickets: ARCH-1253 +# .. toggle_status: supported +DISABLE_DEPRECATED_SIGNUP_URL = False + +# .. toggle_name: DISABLE_DEPRECATED_LOGIN_POST +# .. toggle_implementation: DjangoSetting +# .. toggle_default: False +# .. toggle_description: Toggle for removing the deprecated /login_post url. +# .. toggle_category: n/a +# .. toggle_use_cases: incremental_release +# .. toggle_creation_date: 2019-12-02 +# .. toggle_expiration_date: 2020-06-01 +# .. toggle_warnings: This url can be removed once it no longer has any real traffic. Note: We have permission to remove for traffic from user_agent including `mitx-quantum`. +# .. toggle_tickets: ARCH-1253 +# .. toggle_status: supported +DISABLE_DEPRECATED_LOGIN_POST = False diff --git a/cms/envs/production.py b/cms/envs/production.py index 66e4658e7e66..afa19de42384 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -308,13 +308,6 @@ def get_env_setting(setting): HEARTBEAT_EXTENDED_CHECKS = ENV_TOKENS.get('HEARTBEAT_EXTENDED_CHECKS', HEARTBEAT_EXTENDED_CHECKS) HEARTBEAT_CELERY_TIMEOUT = ENV_TOKENS.get('HEARTBEAT_CELERY_TIMEOUT', HEARTBEAT_CELERY_TIMEOUT) -# Login using the LMS as the identity provider. -# Turning the flag to True means that the LMS will NOT be used as the Identity Provider (idp) -if FEATURES.get('DISABLE_STUDIO_SSO_OVER_LMS', False): - LOGIN_URL = reverse_lazy('login') - FRONTEND_LOGIN_URL = LOGIN_URL - FRONTEND_LOGOUT_URL = reverse_lazy('logout') - LOGIN_REDIRECT_WHITELIST = [reverse_lazy('home')] # Specific setting for the File Upload Service to store media in a bucket. diff --git a/cms/envs/test.py b/cms/envs/test.py index 35bc42324c98..012b5a06cab9 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -19,7 +19,6 @@ import os from uuid import uuid4 - from django.utils.translation import ugettext_lazy from path import Path as path @@ -142,8 +141,6 @@ LMS_BASE = "localhost:8000" LMS_ROOT_URL = "http://{}".format(LMS_BASE) FEATURES['PREVIEW_LMS_BASE'] = "preview.localhost" -LOGIN_URL = EDX_ROOT_URL + '/signin' - CACHES = { # This is the cache used for most things. Askbot will not work without a diff --git a/cms/static/cms/js/build.js b/cms/static/cms/js/build.js index 10dec34c5a09..1abe9f7b14c3 100644 --- a/cms/static/cms/js/build.js +++ b/cms/static/cms/js/build.js @@ -27,7 +27,6 @@ 'js/factories/index', 'js/factories/manage_users', 'js/factories/outline', - 'js/factories/register', 'js/factories/settings', 'js/factories/settings_advanced', 'js/factories/settings_graders', diff --git a/cms/static/cms/js/spec/main_webpack.js b/cms/static/cms/js/spec/main_webpack.js index 5cea9bfd0a87..3ca488a8db4a 100644 --- a/cms/static/cms/js/spec/main_webpack.js +++ b/cms/static/cms/js/spec/main_webpack.js @@ -22,7 +22,6 @@ window.edx.StringUtils = StringUtils; import './xblock/cms.runtime.v1_spec.js'; import '../../../js/spec/factories/xblock_validation_spec.js'; import '../../../js/spec/views/container_spec.js'; -import '../../../js/spec/views/login_studio_spec.js'; import '../../../js/spec/views/modals/edit_xblock_spec.js'; import '../../../js/spec/views/module_edit_spec.js'; import '../../../js/spec/views/move_xblock_spec.js'; diff --git a/cms/static/js/factories/login.js b/cms/static/js/factories/login.js deleted file mode 100644 index b528e075a2ce..000000000000 --- a/cms/static/js/factories/login.js +++ /dev/null @@ -1,63 +0,0 @@ - -'use strict'; - -import cookie from 'jquery.cookie'; -import utility from 'utility'; -import ViewUtils from 'common/js/components/utils/view_utils'; - -export default function LoginFactory(homepageURL) { - function postJSON(url, data, callback) { - $.ajax({ - type: 'POST', - url: url, - dataType: 'json', - data: data, - success: callback - }); - } - - // Clear the login error message when credentials are edited - $('input#email').on('input', function () { - $('#login_error').removeClass('is-shown'); - }); - - $('input#password').on('input', function () { - $('#login_error').removeClass('is-shown'); - }); - - $('form#login_form').submit(function (event) { - event.preventDefault(); - var $submitButton = $('#submit'), - deferred = new $.Deferred(), - promise = deferred.promise(); - ViewUtils.disableElementWhileRunning($submitButton, function () { return promise; }); - var submit_data = $('#login_form').serialize(); - - postJSON('/login_post', submit_data, function (json) { - if (json.success) { - var next = /next=([^&]*)/g.exec(decodeURIComponent(window.location.search)); - if (next && next.length > 1 && !isExternal(next[1])) { - ViewUtils.redirect(next[1]); - } else { - ViewUtils.redirect(homepageURL); - } - } else if ($('#login_error').length === 0) { - $('#login_form').prepend( - '' - ); - $('#login_error').addClass('is-shown'); - deferred.resolve(); - } else { - $('#login_error') - .stop() - .addClass('is-shown') - .html(json.value); - deferred.resolve(); - } - }); - }); -}; - -export { LoginFactory } diff --git a/cms/static/js/factories/register.js b/cms/static/js/factories/register.js deleted file mode 100644 index cb016ac17041..000000000000 --- a/cms/static/js/factories/register.js +++ /dev/null @@ -1,59 +0,0 @@ -define(['jquery', 'jquery.cookie'], function($) { - 'use strict'; - return function() { - $('form :input') - .focus(function() { - $('label[for="' + this.id + '"]').addClass('is-focused'); - }) - .blur(function() { - $('label').removeClass('is-focused'); - }); - - $('form#register_form').submit(function(event) { - event.preventDefault(); - var submit_data = $('#register_form').serialize(); - - $.ajax({ - url: '/create_account', - type: 'POST', - dataType: 'json', - headers: {'X-CSRFToken': $.cookie('csrftoken')}, - notifyOnError: false, - data: submit_data, - success: function(json) { - location.href = '/course/'; - }, - error: function(jqXHR, textStatus, errorThrown) { - var json = $.parseJSON(jqXHR.responseText); - $('#register_error').html(json.value).stop().addClass('is-shown'); - } - }); - }); - - $('input#password').blur(function() { - var $formErrors = $('#password_error'), - data = { - password: $('#password').val() - }; - - // Uninitialize the errors on blur - $formErrors.empty(); - $formErrors.addClass('hidden'); - - $.ajax({ - url: '/api/user/v1/validation/registration', - type: 'POST', - dataType: 'json', - data: data, - success: function(json) { - _.each(json.validation_decisions, function(value, key) { - if (key === 'password' && value) { - $formErrors.html(value); - $formErrors.removeClass('hidden'); - } - }); - } - }); - }); - }; -}); diff --git a/cms/static/js/spec/views/login_studio_spec.js b/cms/static/js/spec/views/login_studio_spec.js deleted file mode 100644 index 38a01dc311aa..000000000000 --- a/cms/static/js/spec/views/login_studio_spec.js +++ /dev/null @@ -1,35 +0,0 @@ - -'use strict'; - -import $ from 'jquery'; -import LoginFactory from 'js/factories/login'; -import AjaxHelpers from 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'; -import ViewUtils from 'common/js/components/utils/view_utils'; - -describe('Studio Login Page', () => { - var $submitButton; - - beforeEach(function() { - loadFixtures('mock/login.underscore'); - var login_factory = LoginFactory('/home/'); - $submitButton = $('#submit'); - }); - - it('disable the submit button once it is clicked', function() { - spyOn(ViewUtils, 'redirect').and.callFake(function() {}); - var requests = AjaxHelpers.requests(this); - expect($submitButton).not.toHaveClass('is-disabled'); - $submitButton.click(); - AjaxHelpers.respondWithJson(requests, {success: true}); - expect($submitButton).toHaveClass('is-disabled'); - }); - - it('It will not disable the submit button if there are errors in ajax request', function() { - var requests = AjaxHelpers.requests(this); - expect($submitButton).not.toHaveClass('is-disabled'); - $submitButton.click(); - expect($submitButton).toHaveClass('is-disabled'); - AjaxHelpers.respondWithError(requests, {}); - expect($submitButton).not.toHaveClass('is-disabled'); - }); -}); diff --git a/cms/templates/activation_active.html b/cms/templates/activation_active.html deleted file mode 100644 index a6e75ecdf816..000000000000 --- a/cms/templates/activation_active.html +++ /dev/null @@ -1,37 +0,0 @@ -<%page expression_filter="h"/> -<%! from django.utils.translation import ugettext as _ %> -<%inherit file="base.html" /> - -<%block name="content"> -${_("This account, set up using {email}, has already been activated. Please sign in to start working within {studio_name}.".format(email=user.email, studio_name=settings.STUDIO_NAME))}
-- ${Text(_("Thank you for activating your account. You may now sign in and start using {studio_name} to author courses.")).format( - studio_name=Text(settings.STUDIO_NAME) - )} -
-${_("We're sorry. Something went wrong with your activation. Check to make sure the URL you went to was correct, as e-mail programs will sometimes split it into two lines.")}
-- ${Text(_("If you still have issues, contact {platform_name} Support. In the meantime, you can also return to {link_start}the {studio_name} homepage.{link_end}")).format( - platform_name=Text(settings.PLATFORM_NAME), - studio_name=Text(settings.STUDIO_NAME), - link_start=HTML(''), - link_end=HTML('') - )} -
-${_("Ready to start creating online courses? Sign up below and start creating your first {platform_name} course today.").format(platform_name=settings.PLATFORM_NAME)}
- -${_("We've sent an email message to {email} with instructions for activating your account.").format(email=email)}
diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 7e81bb5ebe9d..f33497c0534f 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -237,9 +237,6 @@