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
883712b2
Commit
883712b2
authored
Apr 14, 2016
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add logging for when the cert view doesn't render (ECOM-4202)
parent
db9037bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
lms/djangoapps/certificates/views/webview.py
+22
-1
No files found.
lms/djangoapps/certificates/views/webview.py
View file @
883712b2
...
...
@@ -506,6 +506,11 @@ def render_html_view(request, user_id, course_id):
# Kick the user back to the "Invalid" screen if the feature is disabled
if
not
has_html_certificates_enabled
(
course_id
):
log
.
info
(
"Invalid cert: HTML certificates disabled for
%
s. User id:
%
d"
,
course_id
,
user_id
,
)
return
render_to_response
(
invalid_template_path
,
context
)
# Load the course and user objects
...
...
@@ -515,12 +520,22 @@ def render_html_view(request, user_id, course_id):
course
=
modulestore
()
.
get_course
(
course_key
)
# For any other expected exceptions, kick the user back to the "Invalid" screen
except
(
InvalidKeyError
,
ItemNotFoundError
,
User
.
DoesNotExist
):
except
(
InvalidKeyError
,
ItemNotFoundError
,
User
.
DoesNotExist
)
as
exception
:
error_str
=
(
"Invalid cert: error finding course
%
s or user with id "
"
%
d. Specific error:
%
s"
)
log
.
info
(
error_str
,
course_id
,
user_id
,
str
(
exception
))
return
render_to_response
(
invalid_template_path
,
context
)
# Load user's certificate
user_certificate
=
_get_user_certificate
(
request
,
user
,
course_key
,
course
,
preview_mode
)
if
not
user_certificate
:
log
.
info
(
"Invalid cert: User
%
d does not have eligible cert for
%
s."
,
user_id
,
course_id
,
)
return
render_to_response
(
invalid_template_path
,
context
)
# Get the active certificate configuration for this course
...
...
@@ -528,7 +543,13 @@ def render_html_view(request, user_id, course_id):
# Passing in the 'preview' parameter, if specified, will return a configuration, if defined
active_configuration
=
get_active_web_certificate
(
course
,
preview_mode
)
if
active_configuration
is
None
:
log
.
info
(
"Invalid cert: course
%
s does not have an active configuration. User id:
%
d"
,
course_id
,
user_id
,
)
return
render_to_response
(
invalid_template_path
,
context
)
context
[
'certificate_data'
]
=
active_configuration
# Append/Override the existing view context values with any mode-specific ConfigurationModel values
...
...
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