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
f01f4fcc
Commit
f01f4fcc
authored
Dec 15, 2014
by
Renzo Lucioni
Committed by
Zia Fazal
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hook up new payment/verification flow to dashboard, track selection page, and upgrade
parent
88802c9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
common/djangoapps/course_modes/views.py
+28
-8
common/djangoapps/student/tests/test_verification_status.py
+6
-1
lms/templates/dashboard/_dashboard_course_listing.html
+6
-2
No files found.
common/djangoapps/course_modes/views.py
View file @
f01f4fcc
...
...
@@ -4,6 +4,7 @@ Views for the course_mode module
import
decimal
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
django.http
import
HttpResponseBadRequest
from
django.shortcuts
import
redirect
from
django.views.generic.base
import
View
...
...
@@ -62,12 +63,20 @@ class ChooseModeView(View):
# to the usual "choose your track" page.
has_enrolled_professional
=
(
enrollment_mode
==
"professional"
and
is_active
)
if
"professional"
in
modes
and
not
has_enrolled_professional
:
return
redirect
(
reverse
(
'verify_student_show_requirements'
,
kwargs
=
{
'course_id'
:
course_key
.
to_deprecated_string
()}
if
settings
.
FEATURES
.
get
(
'SEPARATE_VERIFICATION_FROM_PAYMENT'
):
return
redirect
(
reverse
(
'verify_student_start_flow'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}
)
)
else
:
return
redirect
(
reverse
(
'verify_student_show_requirements'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}
)
)
)
# If there isn't a verified mode available, then there's nothing
# to do on this page. The user has almost certainly been auto-registered
...
...
@@ -171,9 +180,20 @@ class ChooseModeView(View):
donation_for_course
[
unicode
(
course_key
)]
=
amount_value
request
.
session
[
"donation_for_course"
]
=
donation_for_course
return
redirect
(
reverse
(
'verify_student_show_requirements'
,
kwargs
=
{
'course_id'
:
course_key
.
to_deprecated_string
()})
+
"?upgrade={}"
.
format
(
upgrade
))
if
settings
.
FEATURES
.
get
(
'SEPARATE_VERIFICATION_FROM_PAYMENT'
):
return
redirect
(
reverse
(
'verify_student_start_flow'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}
)
)
else
:
return
redirect
(
reverse
(
'verify_student_show_requirements'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}
)
+
"?upgrade={}"
.
format
(
upgrade
)
)
def
_get_requested_mode
(
self
,
request_dict
):
"""Get the user's requested mode
...
...
common/djangoapps/student/tests/test_verification_status.py
View file @
f01f4fcc
...
...
@@ -21,6 +21,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_st
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
course_modes.tests.factories
import
CourseModeFactory
from
verify_student.models
import
SoftwareSecurePhotoVerification
# pylint: disable=F0401
from
util.testing
import
UrlResetMixin
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
...
...
@@ -33,13 +34,17 @@ MODULESTORE_CONFIG = mixed_store_config(settings.COMMON_TEST_DATA_ROOT, {}, incl
})
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
@ddt.ddt
class
TestCourseVerificationStatus
(
ModuleStoreTestCase
):
class
TestCourseVerificationStatus
(
UrlResetMixin
,
ModuleStoreTestCase
):
"""Tests for per-course verification status on the dashboard. """
PAST
=
datetime
.
now
(
UTC
)
-
timedelta
(
days
=
5
)
FUTURE
=
datetime
.
now
(
UTC
)
+
timedelta
(
days
=
5
)
@patch.dict
(
settings
.
FEATURES
,
{
'SEPARATE_VERIFICATION_FROM_PAYMENT'
:
True
})
def
setUp
(
self
):
# Invoke UrlResetMixin
super
(
TestCourseVerificationStatus
,
self
)
.
setUp
(
'verify_student.urls'
)
self
.
user
=
UserFactory
(
password
=
"edx"
)
self
.
course
=
CourseFactory
.
create
()
success
=
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
"edx"
)
...
...
lms/templates/dashboard/_dashboard_course_listing.html
View file @
f01f4fcc
...
...
@@ -141,7 +141,7 @@
% endif
</div>
<div
class=
"verification-cta"
>
<a
href=
"
#
"
class=
"cta"
>
${_('Verify Now')}
</a>
<a
href=
"
${reverse('verify_student_verify_later', kwargs={'course_id': unicode(course.id)})}
"
class=
"cta"
>
${_('Verify Now')}
</a>
</div>
% elif verification_status['status'] == VERIFY_STATUS_SUBMITTED:
<h4
class=
"message-title"
>
${_('You have already verified your ID!')}
</h4>
...
...
@@ -172,7 +172,11 @@
<ul
class=
"actions message-actions"
>
<li
class=
"action-item"
>
<a
class=
"action action-upgrade"
href=
"${reverse('course_modes_choose', kwargs={'course_id': course.id.to_deprecated_string()})}?upgrade=True"
>
% if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT'):
<a
class=
"action action-upgrade"
href=
"${reverse('verify_student_upgrade_and_verify', kwargs={'course_id': unicode(course.id)})}"
>
% else:
<a
class=
"action action-upgrade"
href=
"${reverse('course_modes_choose', kwargs={'course_id': unicode(course.id)})}?upgrade=True"
>
% endif
<img
class=
"deco-graphic"
src=
"${static.url('images/vcert-ribbon-s.png')}"
alt=
"ID Verified Ribbon/Badge"
>
<span
class=
"wrapper-copy"
>
<span
class=
"copy"
id=
"upgrade-to-verified"
data-course-id=
"${course.id | h}"
data-user=
"${user.username | h}"
>
${_("Upgrade to Verified Track")}
</span>
...
...
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