Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
40cf6ba4
Unverified
Commit
40cf6ba4
authored
4 years ago
by
alangsto
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
updated endpoint for verifications to include receipt id (#25999)
parent
c6497d88
Branches
Branches containing commit
Tags
release-2020-06-18-11.22
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/user_api/serializers.py
+7
-0
7 additions, 0 deletions
openedx/core/djangoapps/user_api/serializers.py
openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
+8
-1
8 additions, 1 deletion
.../djangoapps/user_api/verification_api/tests/test_views.py
with
15 additions
and
1 deletion
openedx/core/djangoapps/user_api/serializers.py
+
7
−
0
View file @
40cf6ba4
...
...
@@ -107,6 +107,7 @@ class IDVerificationDetailsSerializer(serializers.Serializer):
expiration_datetime
=
serializers
.
DateTimeField
()
message
=
serializers
.
SerializerMethodField
()
updated_at
=
serializers
.
DateTimeField
()
receipt_id
=
serializers
.
SerializerMethodField
()
def
get_type
(
self
,
obj
):
if
isinstance
(
obj
,
SoftwareSecurePhotoVerification
):
...
...
@@ -123,3 +124,9 @@ class IDVerificationDetailsSerializer(serializers.Serializer):
return
obj
.
reason
else
:
return
''
def
get_receipt_id
(
self
,
obj
):
if
isinstance
(
obj
,
SoftwareSecurePhotoVerification
):
return
obj
.
receipt_id
else
:
return
None
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
+
8
−
1
View file @
40cf6ba4
...
...
@@ -132,7 +132,8 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
status
'
:
self
.
photo_verification
.
status
,
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
kwargs
.
get
(
'
expected_expires
'
).
isoformat
()),
'
message
'
:
''
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
())
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
self
.
photo_verification
.
receipt_id
,
}]
def
test_multiple_verification_types
(
self
):
...
...
@@ -157,6 +158,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
self
.
photo_verification
.
error_msg
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
self
.
photo_verification
.
receipt_id
},
{
'
type
'
:
'
SSO
'
,
...
...
@@ -164,6 +166,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
''
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
None
,
},
{
'
type
'
:
'
Manual
'
,
...
...
@@ -171,6 +174,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
self
.
manual_verification
.
reason
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
None
,
},
]
self
.
assertEqual
(
json
.
loads
(
response
.
content
.
decode
(
'
utf-8
'
)),
expected
)
...
...
@@ -194,6 +198,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
self
.
photo_verification
.
error_msg
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
self
.
photo_verification
.
receipt_id
,
},
{
'
type
'
:
'
Software Secure
'
,
...
...
@@ -201,6 +206,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
second_ss_photo_verification
.
error_msg
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
second_ss_photo_verification
.
receipt_id
,
},
{
'
type
'
:
'
SSO
'
,
...
...
@@ -208,6 +214,7 @@ class VerificationsDetailsViewTests(VerificationStatusViewTestsMixin, TestCase):
'
expiration_datetime
'
:
'
{}Z
'
.
format
(
expected_expires
.
isoformat
()),
'
message
'
:
''
,
'
updated_at
'
:
'
{}Z
'
.
format
(
self
.
CREATED_AT
.
isoformat
()),
'
receipt_id
'
:
None
,
},
]
self
.
assertEqual
(
json
.
loads
(
response
.
content
.
decode
(
'
utf-8
'
)),
expected
)
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment