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
4f67f0da
Commit
4f67f0da
authored
Sep 08, 2014
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add course_id as merchant defined data
parent
58e6dcf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
lms/djangoapps/verify_student/views.py
+10
-7
No files found.
lms/djangoapps/verify_student/views.py
View file @
4f67f0da
...
...
@@ -34,7 +34,7 @@ from verify_student.models import (
from
reverification.models
import
MidcourseReverificationWindow
import
ssencrypt
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
opaque_keys.edx.
locations
import
SlashSeparated
CourseKey
from
opaque_keys.edx.
keys
import
CourseKey
from
.exceptions
import
WindowExpiredException
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -59,7 +59,7 @@ class VerifyView(View):
"""
upgrade
=
request
.
GET
.
get
(
'upgrade'
,
False
)
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
# If the user has already been verified within the given time period,
# redirect straight to the payment -- no need to verify again.
if
SoftwareSecurePhotoVerification
.
user_has_valid_or_pending
(
request
.
user
):
...
...
@@ -133,7 +133,7 @@ class VerifiedView(View):
Handle the case where we have a get request
"""
upgrade
=
request
.
GET
.
get
(
'upgrade'
,
False
)
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
(
'verified'
,
True
):
return
redirect
(
reverse
(
'dashboard'
))
...
...
@@ -195,7 +195,7 @@ def create_order(request):
attempt
.
save
()
course_id
=
request
.
POST
[
'course_id'
]
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
donation_for_course
=
request
.
session
.
get
(
'donation_for_course'
,
{})
current_donation
=
donation_for_course
.
get
(
unicode
(
course_id
),
decimal
.
Decimal
(
0
))
contribution
=
request
.
POST
.
get
(
"contribution"
,
donation_for_course
.
get
(
unicode
(
course_id
),
0
))
...
...
@@ -230,10 +230,13 @@ def create_order(request):
callback_url
=
request
.
build_absolute_uri
(
reverse
(
"shoppingcart.views.postpay_callback"
)
)
params
=
get_signed_purchase_params
(
cart
,
callback_url
=
callback_url
)
params
[
'success'
]
=
True
params
[
'merchant_defined_data1'
]
=
unicode
(
course_id
)
return
HttpResponse
(
json
.
dumps
(
params
),
content_type
=
"text/json"
)
...
...
@@ -322,7 +325,7 @@ def show_requirements(request, course_id):
Show the requirements necessary for the verification flow.
"""
# TODO: seems borked for professional; we're told we need to take photos even if there's a pending verification
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
upgrade
=
request
.
GET
.
get
(
'upgrade'
,
False
)
if
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_id
)
==
(
'verified'
,
True
):
return
redirect
(
reverse
(
'dashboard'
))
...
...
@@ -421,7 +424,7 @@ class MidCourseReverifyView(View):
"""
display this view
"""
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
course
=
modulestore
()
.
get_course
(
course_id
)
course_enrollment
=
CourseEnrollment
.
get_or_create_enrollment
(
request
.
user
,
course_id
)
course_enrollment
.
update_enrollment
(
mode
=
"verified"
)
...
...
@@ -445,7 +448,7 @@ class MidCourseReverifyView(View):
"""
try
:
now
=
datetime
.
datetime
.
now
(
UTC
)
course_id
=
SlashSeparatedCourseKey
.
from_deprecated
_string
(
course_id
)
course_id
=
CourseKey
.
from
_string
(
course_id
)
window
=
MidcourseReverificationWindow
.
get_window
(
course_id
,
now
)
if
window
is
None
:
raise
WindowExpiredException
...
...
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