Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a4119537
Commit
a4119537
authored
May 19, 2017
by
Uman Shahzad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow configurable activation email support link.
This also serves as a slight refactor of ENT-392.
parent
ea195ff2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
10 deletions
+39
-10
cms/envs/common.py
+1
-0
common/djangoapps/student/tests/test_activate_account.py
+16
-2
common/djangoapps/student/views.py
+11
-4
lms/envs/aws.py
+3
-0
lms/envs/bok_choy.env.json
+1
-0
lms/envs/common.py
+1
-0
lms/envs/test.py
+1
-0
lms/templates/registration/account_activation_sidebar_notice.html
+3
-3
lms/templates/registration/activate_account_notice.html
+2
-1
No files found.
cms/envs/common.py
View file @
a4119537
...
...
@@ -94,6 +94,7 @@ from lms.envs.common import (
HELP_TOKENS_BOOKS
,
SUPPORT_SITE_LINK
,
ACTIVATION_EMAIL_SUPPORT_LINK
,
CONTACT_EMAIL
,
...
...
common/djangoapps/student/tests/test_activate_account.py
View file @
a4119537
...
...
@@ -11,6 +11,7 @@ from uuid import uuid4
from
edxmako.shortcuts
import
render_to_string
from
student.models
import
Registration
from
student.tests.factories
import
UserFactory
from
openedx.core.djangoapps.site_configuration
import
helpers
as
configuration_helpers
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
...
...
@@ -31,6 +32,11 @@ class TestActivateAccount(TestCase):
self
.
registration
.
register
(
self
.
user
)
self
.
registration
.
save
()
self
.
platform_name
=
configuration_helpers
.
get_value
(
'PLATFORM_NAME'
,
settings
.
PLATFORM_NAME
)
self
.
activation_email_support_link
=
configuration_helpers
.
get_value
(
'ACTIVATION_EMAIL_SUPPORT_LINK'
,
settings
.
SUPPORT_SITE_LINK
# Intentional default.
)
def
login
(
self
):
"""
Login with test user.
...
...
@@ -118,7 +124,11 @@ class TestActivateAccount(TestCase):
self
.
login
()
expected_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
{
'email'
:
self
.
user
.
email
}
{
'email'
:
self
.
user
.
email
,
'platform_name'
:
self
.
platform_name
,
'activation_email_support_link'
:
self
.
activation_email_support_link
}
)
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
...
...
@@ -130,7 +140,11 @@ class TestActivateAccount(TestCase):
self
.
login
()
expected_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
{
'email'
:
self
.
user
.
email
}
{
'email'
:
self
.
user
.
email
,
'platform_name'
:
self
.
platform_name
,
'activation_email_support_link'
:
self
.
activation_email_support_link
}
)
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
self
.
assertNotContains
(
response
,
expected_message
,
html
=
True
)
...
...
common/djangoapps/student/views.py
View file @
a4119537
...
...
@@ -657,6 +657,9 @@ def dashboard(request):
'DISPLAY_COURSE_MODES_ON_DASHBOARD'
,
settings
.
FEATURES
.
get
(
'DISPLAY_COURSE_MODES_ON_DASHBOARD'
,
True
)
)
activation_email_support_link
=
configuration_helpers
.
get_value
(
'ACTIVATION_EMAIL_SUPPORT_LINK'
,
settings
.
SUPPORT_SITE_LINK
)
# Let's filter out any courses in an "org" that has been declared to be
# in a configuration
...
...
@@ -712,12 +715,16 @@ def dashboard(request):
if
display_account_activation_message_on_sidebar
and
not
user
.
is_active
:
sidebar_account_activation_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
{
'email'
:
user
.
email
}
{
'email'
:
user
.
email
,
'platform_name'
:
platform_name
,
'activation_email_support_link'
:
activation_email_support_link
}
)
elif
not
user
.
is_active
:
banner_account_activation_message
=
render_to_string
(
'registration/activate_account_notice.html'
,
{
'email'
:
user
.
email
,
'platform_name'
:
platform_name
}
{
'email'
:
user
.
email
}
)
enterprise_message
=
get_dashboard_consent_notification
(
request
,
user
,
course_enrollments
)
...
...
@@ -727,11 +734,11 @@ def dashboard(request):
message
for
message
in
messages
.
get_messages
(
request
)
if
'account-activation'
in
message
.
tags
]
# Global staff can see what courses e
rrored
on their dashboard
# Global staff can see what courses e
ncountered an error
on their dashboard
staff_access
=
False
errored_courses
=
{}
if
has_access
(
user
,
'staff'
,
'global'
):
# Show any courses that e
rrored
on load
# Show any courses that e
ncountered an error
on load
staff_access
=
True
errored_courses
=
modulestore
()
.
get_errored_courses
()
...
...
lms/envs/aws.py
View file @
a4119537
...
...
@@ -310,6 +310,9 @@ ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', EN
MKTG_URL_LINK_MAP
.
update
(
ENV_TOKENS
.
get
(
'MKTG_URL_LINK_MAP'
,
{}))
SUPPORT_SITE_LINK
=
ENV_TOKENS
.
get
(
'SUPPORT_SITE_LINK'
,
SUPPORT_SITE_LINK
)
ACTIVATION_EMAIL_SUPPORT_LINK
=
ENV_TOKENS
.
get
(
'ACTIVATION_EMAIL_SUPPORT_LINK'
,
SUPPORT_SITE_LINK
# Intentional default.
)
# Mobile store URL overrides
MOBILE_STORE_URLS
=
ENV_TOKENS
.
get
(
'MOBILE_STORE_URLS'
,
MOBILE_STORE_URLS
)
...
...
lms/envs/bok_choy.env.json
View file @
a4119537
...
...
@@ -137,6 +137,7 @@
"SITE_NAME"
:
"localhost:8003"
,
"STATIC_URL_BASE"
:
"/static/"
,
"SUPPORT_SITE_LINK"
:
"https://support.example.com"
,
"ACTIVATION_EMAIL_SUPPORT_LINK"
:
"https://support.example.com/activation-email-help.html"
,
"SYSLOG_SERVER"
:
""
,
"TECH_SUPPORT_EMAIL"
:
"technical@example.com"
,
"THIRD_PARTY_AUTH_BACKENDS"
:
[
...
...
lms/envs/common.py
View file @
a4119537
...
...
@@ -2268,6 +2268,7 @@ MKTG_URL_LINK_MAP = {
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION
=
'html'
SUPPORT_SITE_LINK
=
''
ACTIVATION_EMAIL_SUPPORT_LINK
=
''
############################# SOCIAL MEDIA SHARING #############################
# Social Media Sharing on Student Dashboard
...
...
lms/envs/test.py
View file @
a4119537
...
...
@@ -361,6 +361,7 @@ MKTG_URL_LINK_MAP = {
}
SUPPORT_SITE_LINK
=
'https://support.example.com'
ACTIVATION_EMAIL_SUPPORT_LINK
=
'https://support.example.com/activation-email-help.html'
############################ STATIC FILES #############################
DEFAULT_FILE_STORAGE
=
'django.core.files.storage.FileSystemStorage'
...
...
lms/templates/registration/account_activation_sidebar_notice.html
View file @
a4119537
<
%
page
expression_filter=
"h"
/>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
from
openedx
.
core
.
djangoapps
.
site_configuration
import
helpers
as
configuration_helpers
from
openedx
.
core
.
djangolib
.
markup
import
HTML
,
Text
%
>
<div
class=
"profile-sidebar"
role=
"region"
aria-labelledby=
"account-activation-title"
>
...
...
@@ -20,11 +19,12 @@ from openedx.core.djangolib.markup import HTML, Text
"Check your {email_start}{email}{email_end} inbox for an account activation link from {platform_name}. "
"If you need help, contact {link_start}{platform_name} Support{link_end}."
)).format(
platform_name=platform_name,
email_start=HTML("
<strong>
"),
email_end=HTML("
</strong>
"),
email=email,
platform_name=configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
,
link_start=HTML("
<a
target=
'_blank'
href=
'
https://support.edx.org/hc/en-us/articles/227340127-Why-haven-t-I-received-my-activation-email-
'
>
"),
activation_email_support_link=activation_email_support_link
,
link_start=HTML("
<a
target=
'_blank'
href=
'
${activation_email_support_link}
'
>
"),
link_end=HTML("
</a>
"),
)}
</p>
...
...
lms/templates/registration/activate_account_notice.html
View file @
a4119537
...
...
@@ -16,7 +16,8 @@ from openedx.core.djangolib.markup import HTML, Text
"instructions for activating your account. If "
"you don't receive this message, check your "
"spam folder."
)).format(email_start=HTML("
<strong>
"),
)).format(
email_start=HTML("
<strong>
"),
email_end=HTML("
</strong>
"),
email=email,
)}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment