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
571be1f5
Unverified
Commit
571be1f5
authored
Dec 05, 2017
by
Ayub khan
Committed by
GitHub
Dec 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16779 from edx/LEARNER-3399
Learner-3399 fix for certificates
parents
dd78ea59
1b774d15
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
lms/djangoapps/certificates/tests/test_webview_views.py
+1
-1
lms/djangoapps/certificates/views/webview.py
+1
-8
No files found.
lms/djangoapps/certificates/tests/test_webview_views.py
View file @
571be1f5
...
...
@@ -658,7 +658,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase):
self
.
assertIn
(
"We cannot find a certificate with this URL or ID number."
,
response
.
content
)
@override_settings
(
FEATURES
=
FEATURES_WITH_CERTS_ENABLED
)
def
test_html_view_for_non_viewable_certificate
(
self
):
def
test_html_view_for_non_viewable_certificate
_and_for_student_user
(
self
):
"""
Tests that Certificate HTML Web View returns "Cannot Find Certificate" if certificate is not viewable yet.
"""
...
...
lms/djangoapps/certificates/views/webview.py
View file @
571be1f5
...
...
@@ -350,7 +350,7 @@ def _get_user_certificate(request, user, course_key, course, preview_mode=None):
verify_uuid
=
unicode
(
uuid4
()
.
hex
),
modified_date
=
modified_date
)
el
se
:
el
if
certificates_viewable_for_course
(
course
)
:
# certificate is being viewed by learner or public
try
:
user_certificate
=
GeneratedCertificate
.
eligible_certificates
.
get
(
...
...
@@ -516,13 +516,6 @@ def render_html_view(request, user_id, course_id):
log
.
info
(
error_str
,
course_id
,
user_id
,
str
(
exception
))
return
_render_invalid_certificate
(
course_id
,
platform_name
,
configuration
)
if
not
certificates_viewable_for_course
(
course
):
log
.
info
(
"Invalid cert: Certificate for
%
s is not viewable yet."
,
course_id
,
)
return
_render_invalid_certificate
(
course_id
,
platform_name
,
configuration
)
# Kick the user back to the "Invalid" screen if the feature is disabled for the course
if
not
course
.
cert_html_view_enabled
:
log
.
info
(
...
...
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