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
431eb8f4
Commit
431eb8f4
authored
11 years ago
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove 'preview' from urls in enrollment emails sent while previewing a course
parent
0db8ad28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
lms/djangoapps/instructor/views/legacy.py
+12
-4
No files found.
lms/djangoapps/instructor/views/legacy.py
View file @
431eb8f4
...
...
@@ -1119,13 +1119,14 @@ def _do_enroll_students(course, course_id, students, overload=False, auto_enroll
ceaset
.
delete
()
if
email_students
:
registration_url
=
'https://'
+
settings
.
SITE_NAME
+
reverse
(
'student.views.register_user'
)
stripped_site_name
=
_remove_preview
(
settings
.
SITE_NAME
)
registration_url
=
'https://'
+
stripped_site_name
+
reverse
(
'student.views.register_user'
)
#Composition of email
d
=
{
'site_name'
:
s
ettings
.
SITE_NAME
,
d
=
{
'site_name'
:
s
tripped_site_name
,
'registration_url'
:
registration_url
,
'course_id'
:
course_id
,
'auto_enroll'
:
auto_enroll
,
'course_url'
:
'https://'
+
s
ettings
.
SITE_NAME
+
'/courses/'
+
course_id
,
'course_url'
:
'https://'
+
s
tripped_site_name
+
'/courses/'
+
course_id
,
}
for
student
in
new_students
:
...
...
@@ -1209,9 +1210,10 @@ def _do_unenroll_students(course_id, students, email_students=False):
old_students
,
_
=
get_and_clean_student_list
(
students
)
status
=
dict
([
x
,
'unprocessed'
]
for
x
in
old_students
)
stripped_site_name
=
_remove_preview
(
settings
.
SITE_NAME
)
if
email_students
:
#Composition of email
d
=
{
'site_name'
:
s
ettings
.
SITE_NAME
,
d
=
{
'site_name'
:
s
tripped_site_name
,
'course_id'
:
course_id
}
for
student
in
old_students
:
...
...
@@ -1301,6 +1303,12 @@ def send_mail_to_student(student, param_dict):
return
False
def
_remove_preview
(
site_name
):
if
site_name
[:
8
]
==
"preview."
:
return
site_name
[
8
:]
return
site_name
def
get_and_clean_student_list
(
students
):
"""
Separate out individual student email from the comma, or space separated string.
...
...
This diff is collapsed.
Click to expand it.
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