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
1512c060
Commit
1512c060
authored
Mar 10, 2015
by
aamir-khan
Committed by
Awais
Mar 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-1177: Removed the session variable on pay_and_verify view
parent
f473c474
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
11 deletions
+1
-11
lms/djangoapps/verify_student/tests/test_views.py
+1
-6
lms/djangoapps/verify_student/views.py
+0
-5
No files found.
lms/djangoapps/verify_student/tests/test_views.py
View file @
1512c060
...
@@ -885,12 +885,7 @@ class TestCreateOrder(ModuleStoreTestCase):
...
@@ -885,12 +885,7 @@ class TestCreateOrder(ModuleStoreTestCase):
self
.
client
.
post
(
url
,
params
)
self
.
client
.
post
(
url
,
params
)
# Verify that the client's session contains the new donation amount
# Verify that the client's session contains the new donation amount
self
.
assertIn
(
'donation_for_course'
,
self
.
client
.
session
)
self
.
assertNotIn
(
'donation_for_course'
,
self
.
client
.
session
)
self
.
assertIn
(
unicode
(
self
.
course
.
id
),
self
.
client
.
session
[
'donation_for_course'
])
actual_amount
=
self
.
client
.
session
[
'donation_for_course'
][
unicode
(
self
.
course
.
id
)]
expected_amount
=
decimal
.
Decimal
(
'1.23'
)
self
.
assertEqual
(
actual_amount
,
expected_amount
)
def
_verify_student
(
self
):
def
_verify_student
(
self
):
""" Simulate that the student's identity has already been verified. """
""" Simulate that the student's identity has already been verified. """
...
...
lms/djangoapps/verify_student/views.py
View file @
1512c060
...
@@ -636,17 +636,12 @@ def create_order(request):
...
@@ -636,17 +636,12 @@ def create_order(request):
course_id
=
request
.
POST
[
'course_id'
]
course_id
=
request
.
POST
[
'course_id'
]
course_id
=
CourseKey
.
from_string
(
course_id
)
course_id
=
CourseKey
.
from_string
(
course_id
)
donation_for_course
=
request
.
session
.
get
(
'donation_for_course'
,
{})
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
))
contribution
=
request
.
POST
.
get
(
"contribution"
,
donation_for_course
.
get
(
unicode
(
course_id
),
0
))
try
:
try
:
amount
=
decimal
.
Decimal
(
contribution
)
.
quantize
(
decimal
.
Decimal
(
'.01'
),
rounding
=
decimal
.
ROUND_DOWN
)
amount
=
decimal
.
Decimal
(
contribution
)
.
quantize
(
decimal
.
Decimal
(
'.01'
),
rounding
=
decimal
.
ROUND_DOWN
)
except
decimal
.
InvalidOperation
:
except
decimal
.
InvalidOperation
:
return
HttpResponseBadRequest
(
_
(
"Selected price is not valid number."
))
return
HttpResponseBadRequest
(
_
(
"Selected price is not valid number."
))
if
amount
!=
current_donation
:
donation_for_course
[
unicode
(
course_id
)]
=
amount
request
.
session
[
'donation_for_course'
]
=
donation_for_course
# prefer professional mode over verified_mode
# prefer professional mode over verified_mode
current_mode
=
CourseMode
.
verified_mode_for_course
(
course_id
)
current_mode
=
CourseMode
.
verified_mode_for_course
(
course_id
)
...
...
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