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
6894dafa
Commit
6894dafa
authored
May 26, 2017
by
Douglas Hall
Committed by
GitHub
May 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15161 from open-craft/uman/OC-2663
ENT-392 Refactoring
parents
ea195ff2
a4119537
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 @
6894dafa
...
@@ -94,6 +94,7 @@ from lms.envs.common import (
...
@@ -94,6 +94,7 @@ from lms.envs.common import (
HELP_TOKENS_BOOKS
,
HELP_TOKENS_BOOKS
,
SUPPORT_SITE_LINK
,
SUPPORT_SITE_LINK
,
ACTIVATION_EMAIL_SUPPORT_LINK
,
CONTACT_EMAIL
,
CONTACT_EMAIL
,
...
...
common/djangoapps/student/tests/test_activate_account.py
View file @
6894dafa
...
@@ -11,6 +11,7 @@ from uuid import uuid4
...
@@ -11,6 +11,7 @@ from uuid import uuid4
from
edxmako.shortcuts
import
render_to_string
from
edxmako.shortcuts
import
render_to_string
from
student.models
import
Registration
from
student.models
import
Registration
from
student.tests.factories
import
UserFactory
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'
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
...
@@ -31,6 +32,11 @@ class TestActivateAccount(TestCase):
...
@@ -31,6 +32,11 @@ class TestActivateAccount(TestCase):
self
.
registration
.
register
(
self
.
user
)
self
.
registration
.
register
(
self
.
user
)
self
.
registration
.
save
()
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
):
def
login
(
self
):
"""
"""
Login with test user.
Login with test user.
...
@@ -118,7 +124,11 @@ class TestActivateAccount(TestCase):
...
@@ -118,7 +124,11 @@ class TestActivateAccount(TestCase):
self
.
login
()
self
.
login
()
expected_message
=
render_to_string
(
expected_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
'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'
))
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
...
@@ -130,7 +140,11 @@ class TestActivateAccount(TestCase):
...
@@ -130,7 +140,11 @@ class TestActivateAccount(TestCase):
self
.
login
()
self
.
login
()
expected_message
=
render_to_string
(
expected_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
'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'
))
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
self
.
assertNotContains
(
response
,
expected_message
,
html
=
True
)
self
.
assertNotContains
(
response
,
expected_message
,
html
=
True
)
...
...
common/djangoapps/student/views.py
View file @
6894dafa
...
@@ -657,6 +657,9 @@ def dashboard(request):
...
@@ -657,6 +657,9 @@ def dashboard(request):
'DISPLAY_COURSE_MODES_ON_DASHBOARD'
,
'DISPLAY_COURSE_MODES_ON_DASHBOARD'
,
settings
.
FEATURES
.
get
(
'DISPLAY_COURSE_MODES_ON_DASHBOARD'
,
True
)
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
# Let's filter out any courses in an "org" that has been declared to be
# in a configuration
# in a configuration
...
@@ -712,12 +715,16 @@ def dashboard(request):
...
@@ -712,12 +715,16 @@ def dashboard(request):
if
display_account_activation_message_on_sidebar
and
not
user
.
is_active
:
if
display_account_activation_message_on_sidebar
and
not
user
.
is_active
:
sidebar_account_activation_message
=
render_to_string
(
sidebar_account_activation_message
=
render_to_string
(
'registration/account_activation_sidebar_notice.html'
,
'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
:
elif
not
user
.
is_active
:
banner_account_activation_message
=
render_to_string
(
banner_account_activation_message
=
render_to_string
(
'registration/activate_account_notice.html'
,
'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
)
enterprise_message
=
get_dashboard_consent_notification
(
request
,
user
,
course_enrollments
)
...
@@ -727,11 +734,11 @@ def dashboard(request):
...
@@ -727,11 +734,11 @@ def dashboard(request):
message
for
message
in
messages
.
get_messages
(
request
)
if
'account-activation'
in
message
.
tags
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
staff_access
=
False
errored_courses
=
{}
errored_courses
=
{}
if
has_access
(
user
,
'staff'
,
'global'
):
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
staff_access
=
True
errored_courses
=
modulestore
()
.
get_errored_courses
()
errored_courses
=
modulestore
()
.
get_errored_courses
()
...
...
lms/envs/aws.py
View file @
6894dafa
...
@@ -310,6 +310,9 @@ ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', EN
...
@@ -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'
,
{}))
MKTG_URL_LINK_MAP
.
update
(
ENV_TOKENS
.
get
(
'MKTG_URL_LINK_MAP'
,
{}))
SUPPORT_SITE_LINK
=
ENV_TOKENS
.
get
(
'SUPPORT_SITE_LINK'
,
SUPPORT_SITE_LINK
)
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 URL overrides
MOBILE_STORE_URLS
=
ENV_TOKENS
.
get
(
'MOBILE_STORE_URLS'
,
MOBILE_STORE_URLS
)
MOBILE_STORE_URLS
=
ENV_TOKENS
.
get
(
'MOBILE_STORE_URLS'
,
MOBILE_STORE_URLS
)
...
...
lms/envs/bok_choy.env.json
View file @
6894dafa
...
@@ -137,6 +137,7 @@
...
@@ -137,6 +137,7 @@
"SITE_NAME"
:
"localhost:8003"
,
"SITE_NAME"
:
"localhost:8003"
,
"STATIC_URL_BASE"
:
"/static/"
,
"STATIC_URL_BASE"
:
"/static/"
,
"SUPPORT_SITE_LINK"
:
"https://support.example.com"
,
"SUPPORT_SITE_LINK"
:
"https://support.example.com"
,
"ACTIVATION_EMAIL_SUPPORT_LINK"
:
"https://support.example.com/activation-email-help.html"
,
"SYSLOG_SERVER"
:
""
,
"SYSLOG_SERVER"
:
""
,
"TECH_SUPPORT_EMAIL"
:
"technical@example.com"
,
"TECH_SUPPORT_EMAIL"
:
"technical@example.com"
,
"THIRD_PARTY_AUTH_BACKENDS"
:
[
"THIRD_PARTY_AUTH_BACKENDS"
:
[
...
...
lms/envs/common.py
View file @
6894dafa
...
@@ -2268,6 +2268,7 @@ MKTG_URL_LINK_MAP = {
...
@@ -2268,6 +2268,7 @@ MKTG_URL_LINK_MAP = {
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION
=
'html'
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION
=
'html'
SUPPORT_SITE_LINK
=
''
SUPPORT_SITE_LINK
=
''
ACTIVATION_EMAIL_SUPPORT_LINK
=
''
############################# SOCIAL MEDIA SHARING #############################
############################# SOCIAL MEDIA SHARING #############################
# Social Media Sharing on Student Dashboard
# Social Media Sharing on Student Dashboard
...
...
lms/envs/test.py
View file @
6894dafa
...
@@ -361,6 +361,7 @@ MKTG_URL_LINK_MAP = {
...
@@ -361,6 +361,7 @@ MKTG_URL_LINK_MAP = {
}
}
SUPPORT_SITE_LINK
=
'https://support.example.com'
SUPPORT_SITE_LINK
=
'https://support.example.com'
ACTIVATION_EMAIL_SUPPORT_LINK
=
'https://support.example.com/activation-email-help.html'
############################ STATIC FILES #############################
############################ STATIC FILES #############################
DEFAULT_FILE_STORAGE
=
'django.core.files.storage.FileSystemStorage'
DEFAULT_FILE_STORAGE
=
'django.core.files.storage.FileSystemStorage'
...
...
lms/templates/registration/account_activation_sidebar_notice.html
View file @
6894dafa
<
%
page
expression_filter=
"h"
/>
<
%
page
expression_filter=
"h"
/>
<
%!
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
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
from
openedx
.
core
.
djangolib
.
markup
import
HTML
,
Text
%
>
%
>
<div
class=
"profile-sidebar"
role=
"region"
aria-labelledby=
"account-activation-title"
>
<div
class=
"profile-sidebar"
role=
"region"
aria-labelledby=
"account-activation-title"
>
...
@@ -20,11 +19,12 @@ from openedx.core.djangolib.markup import HTML, Text
...
@@ -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}. "
"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}."
"If you need help, contact {link_start}{platform_name} Support{link_end}."
)).format(
)).format(
platform_name=platform_name,
email_start=HTML("
<strong>
"),
email_start=HTML("
<strong>
"),
email_end=HTML("
</strong>
"),
email_end=HTML("
</strong>
"),
email=email,
email=email,
platform_name=configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
,
activation_email_support_link=activation_email_support_link
,
link_start=HTML("
<a
target=
'_blank'
href=
'
https://support.edx.org/hc/en-us/articles/227340127-Why-haven-t-I-received-my-activation-email-
'
>
"),
link_start=HTML("
<a
target=
'_blank'
href=
'
${activation_email_support_link}
'
>
"),
link_end=HTML("
</a>
"),
link_end=HTML("
</a>
"),
)}
)}
</p>
</p>
...
...
lms/templates/registration/activate_account_notice.html
View file @
6894dafa
...
@@ -16,7 +16,8 @@ from openedx.core.djangolib.markup import HTML, Text
...
@@ -16,7 +16,8 @@ from openedx.core.djangolib.markup import HTML, Text
"instructions for activating your account. If "
"instructions for activating your account. If "
"you don't receive this message, check your "
"you don't receive this message, check your "
"spam folder."
"spam folder."
)).format(email_start=HTML("
<strong>
"),
)).format(
email_start=HTML("
<strong>
"),
email_end=HTML("
</strong>
"),
email_end=HTML("
</strong>
"),
email=email,
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