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
442db0b4
Commit
442db0b4
authored
Apr 21, 2014
by
Waqas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User doesn't exist in verify student banner toggle off view
LMS-2510
parent
c9b419d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
lms/djangoapps/verify_student/tests/test_views.py
+24
-0
lms/djangoapps/verify_student/views.py
+5
-1
lms/templates/dashboard.html
+1
-2
No files found.
lms/djangoapps/verify_student/tests/test_views.py
View file @
442db0b4
# encoding: utf-8
"""
...
...
@@ -215,3 +216,26 @@ class TestMidCourseReverifyView(TestCase):
response
=
self
.
client
.
get
(
url
)
# enrolled in a verified course, and the window is open
self
.
assertEquals
(
response
.
status_code
,
200
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MONGO_MODULESTORE
)
class
TestReverificationBanner
(
TestCase
):
""" Tests for the midcourse reverification failed toggle banner off """
@patch.dict
(
settings
.
FEATURES
,
{
'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'
:
True
})
def
setUp
(
self
):
self
.
user
=
UserFactory
.
create
(
username
=
"rusty"
,
password
=
"test"
)
self
.
client
.
login
(
username
=
"rusty"
,
password
=
"test"
)
self
.
course_id
=
'Robot/999/Test_Course'
CourseFactory
.
create
(
org
=
'Robot'
,
number
=
'999'
,
display_name
=
u'Test Course é'
)
self
.
window
=
MidcourseReverificationWindowFactory
(
course_id
=
self
.
course_id
)
url
=
reverse
(
'verify_student_midcourse_reverify'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
self
.
client
.
post
(
url
,
{
'face_image'
:
','
})
photo_verification
=
SoftwareSecurePhotoVerification
.
objects
.
get
(
user
=
self
.
user
,
window
=
self
.
window
)
photo_verification
.
status
=
'denied'
photo_verification
.
save
()
def
test_banner_display_off
(
self
):
self
.
client
.
post
(
reverse
(
'verify_student_toggle_failed_banner_off'
))
photo_verification
=
SoftwareSecurePhotoVerification
.
objects
.
get
(
user
=
self
.
user
,
window
=
self
.
window
)
self
.
assertFalse
(
photo_verification
.
display
)
lms/djangoapps/verify_student/views.py
View file @
442db0b4
...
...
@@ -439,13 +439,17 @@ def midcourse_reverify_dash(request):
return
render_to_response
(
"verify_student/midcourse_reverify_dash.html"
,
context
)
@login_required
@require_POST
def
toggle_failed_banner_off
(
request
):
"""
Finds all denied midcourse reverifications for a user and permanently toggles
the "Reverification Failed" banner off for those verifications.
"""
user_id
=
request
.
POST
.
get
(
'user_id'
)
user_id
=
request
.
user
.
id
SoftwareSecurePhotoVerification
.
display_off
(
user_id
)
return
HttpResponse
(
'Success'
)
@login_required
...
...
lms/templates/dashboard.html
View file @
442db0b4
...
...
@@ -34,8 +34,7 @@
$
(
"#failed-verification-button-dismiss"
).
click
(
function
(
event
)
{
$
.
ajax
({
url
:
"${reverse('verify_student_toggle_failed_banner_off')}"
,
type
:
"post"
,
data
:
{
'user_id'
:
$
{
user
.
id
},
}
type
:
"post"
})
$
(
"#failed-verification-banner"
).
addClass
(
'is-hidden'
);
})
...
...
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