Convert Account Activation Emails to edx-ACE

This commit is contained in:
Shadi Naif
2018-09-13 14:51:16 +03:00
committed by Mahyar Damavand
parent c3735cef01
commit 7984c37a4f
19 changed files with 235 additions and 227 deletions

View File

@@ -29,8 +29,8 @@ from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError
from openedx.core.djangoapps.util.user_messages import PageLevelMessages
from openedx.core.djangolib.markup import HTML, Text
from student.forms import send_password_reset_email_for_user
from student.models import LoginFailures
from student.views import send_reactivation_email_for_user
from student.models import LoginFailures, UserProfile
from student.views import compose_and_send_activation_email
from third_party_auth import pipeline, provider
from track import segment
from util.json_request import JsonResponse
@@ -166,7 +166,9 @@ def _log_and_raise_inactive_user_auth_error(unauthenticated_user):
unauthenticated_user.username)
)
send_reactivation_email_for_user(unauthenticated_user)
profile = UserProfile.objects.get(user=unauthenticated_user)
compose_and_send_activation_email(unauthenticated_user, profile)
raise AuthFailedError(_generate_not_activated_message(unauthenticated_user))

View File

@@ -19,6 +19,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin
from openedx.core.djangoapps.django_comment_common.models import ForumsConfig
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
@@ -91,7 +92,7 @@ def get_mock_pipeline_data(username=TEST_USERNAME, email=TEST_EMAIL):
]
}
)
class TestCreateAccount(SiteMixin, TestCase):
class TestCreateAccount(EmailTemplateTagMixin, SiteMixin, TestCase):
"""Tests for account creation"""
def setUp(self):