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
b9a285f1
Commit
b9a285f1
authored
Aug 08, 2014
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4756 from edx/flowerhack/prof-ed-reg-button
Redirect to show_reqs for prof ed
parents
2a9c9ee7
91e90b36
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
4 deletions
+68
-4
common/djangoapps/course_modes/tests/test_views.py
+42
-0
common/djangoapps/course_modes/views.py
+16
-2
lms/djangoapps/courseware/views.py
+1
-1
lms/templates/courseware/mktg_course_about.html
+9
-1
No files found.
common/djangoapps/course_modes/tests/test_views.py
View file @
b9a285f1
...
...
@@ -98,3 +98,45 @@ class CourseModeViewTest(TestCase):
self
.
assertEquals
(
response
.
status_code
,
200
)
# TODO: Fix it so that response.templates works w/ mako templates, and then assert
# that the right template rendered
class
ProfessionalModeViewTest
(
TestCase
):
"""
Tests for redirects specific to the 'professional' course mode.
Can't really put this in the ddt-style tests in CourseModeViewTest,
since 'professional' mode implies it is the *only* mode for a course
"""
def
setUp
(
self
):
self
.
course_id
=
SlashSeparatedCourseKey
(
'org'
,
'course'
,
'run'
)
CourseModeFactory
(
mode_slug
=
'professional'
,
course_id
=
self
.
course_id
)
self
.
user
=
UserFactory
()
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
def
test_professional_registration
(
self
):
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
'test'
)
response
=
self
.
client
.
get
(
reverse
(
'course_modes_choose'
,
args
=
[
self
.
course_id
.
to_deprecated_string
()]),
follow
=
False
,
)
self
.
assertEquals
(
response
.
status_code
,
302
)
self
.
assertTrue
(
response
[
'Location'
]
.
endswith
(
reverse
(
'verify_student_show_requirements'
,
args
=
[
unicode
(
self
.
course_id
)])))
CourseEnrollmentFactory
(
user
=
self
.
user
,
is_active
=
True
,
mode
=
"professional"
,
course_id
=
unicode
(
self
.
course_id
),
)
response
=
self
.
client
.
get
(
reverse
(
'course_modes_choose'
,
args
=
[
self
.
course_id
.
to_deprecated_string
()]),
follow
=
False
,
)
self
.
assertEquals
(
response
.
status_code
,
302
)
self
.
assertTrue
(
response
[
'Location'
]
.
endswith
(
reverse
(
'dashboard'
)))
common/djangoapps/course_modes/views.py
View file @
b9a285f1
...
...
@@ -41,12 +41,26 @@ class ChooseModeView(View):
request
.
session
[
'attempting_upgrade'
]
=
upgrade
# Inactive users always need to re-register
# verified users do not need to register or upgrade
# verified
and professional
users do not need to register or upgrade
# registered users who are not trying to upgrade do not need to re-register
if
is_active
and
(
upgrade
is
False
or
enrollment_mode
==
'verified'
):
if
is_active
and
(
upgrade
is
False
or
enrollment_mode
==
'verified'
or
enrollment_mode
==
'professional'
):
return
redirect
(
reverse
(
'dashboard'
))
modes
=
CourseMode
.
modes_for_course_dict
(
course_key
)
# We assume that, if 'professional' is one of the modes, it is the *only* mode.
# If we offer more modes alongside 'professional' in the future, this will need to route
# to the usual "choose your track" page.
if
"professional"
in
modes
:
return
redirect
(
reverse
(
'verify_student_show_requirements'
,
kwargs
=
{
'course_id'
:
course_key
.
to_deprecated_string
()}
)
)
donation_for_course
=
request
.
session
.
get
(
"donation_for_course"
,
{})
chosen_price
=
donation_for_course
.
get
(
course_key
,
None
)
...
...
lms/djangoapps/courseware/views.py
View file @
b9a285f1
...
...
@@ -708,7 +708,7 @@ def mktg_course_about(request, course_id):
show_courseware_link
=
(
has_access
(
request
.
user
,
'load'
,
course
)
or
settings
.
FEATURES
.
get
(
'ENABLE_LMS_MIGRATION'
))
course_modes
=
CourseMode
.
modes_for_course
(
course
.
id
)
course_modes
=
CourseMode
.
modes_for_course
_dict
(
course
.
id
)
return
render_to_response
(
'courseware/mktg_course_about.html'
,
{
'course'
:
course
,
...
...
lms/templates/courseware/mktg_course_about.html
View file @
b9a285f1
...
...
@@ -55,7 +55,15 @@
<a
class=
"action action-register register ${'has-option-verified' if len(course_modes) > 1 else ''}"
href=
"#"
>
${_("Register for")}
<strong>
${course.display_number_with_default | h}
</strong>
%if len(course_modes) > 1:
<span
class=
"track"
>
and choose your student track
## Translators: This is the second line on a button users can click. The first line is "Register for COURSE_NAME"
## The "choose your student track" means users can select between taking the course as an auditor, as a verified student, etc
${_("and choose your student track")}
</span>
%elif "professional" in course_modes:
<span
class=
"track"
>
## Translators: This is the second line on a button users can click. The first line is "Register for COURSE_NAME"
## 'Verification' here refers to verifying one's identity in order to receive a verified certificate.
${_("and proceed to verification")}
</span>
%endif
</a>
...
...
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