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
5a03b53a
Commit
5a03b53a
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
cert bugfix: handle students who don't have a grade
parent
36486302
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/student/views.py
+20
-6
20 additions, 6 deletions
common/djangoapps/student/views.py
with
20 additions
and
6 deletions
common/djangoapps/student/views.py
+
20
−
6
View file @
5a03b53a
...
...
@@ -149,11 +149,14 @@ def _cert_info(user, course, cert_status):
Implements the logic for cert_info -- split out for testing.
"""
default_status
=
'
processing
'
default_info
=
{
'
status
'
:
default_status
,
'
show_disabled_download_button
'
:
False
,
'
show_download_url
'
:
False
,
'
show_survey_button
'
:
False
}
if
cert_status
is
None
:
return
{
'
status
'
:
default_status
,
'
show_disabled_download_button
'
:
False
,
'
show_download_url
'
:
False
,
'
show_survey_button
'
:
False
}
return
default_info
# simplify the status for the template using this lookup table
template_state
=
{
...
...
@@ -178,10 +181,21 @@ def _cert_info(user, course, cert_status):
d
[
'
show_survey_button
'
]
=
False
if
status
==
'
ready
'
:
d
[
'
download_url
'
]
=
cert_status
[
'
download_url
'
]
if
'
download_url
'
not
in
cert_status
:
log
.
warning
(
"
User %s has a downloadable cert for %s, but no download url
"
,
user
.
username
,
course
.
id
)
return
default_status
else
:
d
[
'
download_url
'
]
=
cert_status
[
'
download_url
'
]
if
status
in
(
'
generating
'
,
'
ready
'
,
'
notpassing
'
):
d
[
'
grade
'
]
=
cert_status
[
'
grade
'
]
if
'
grade
'
not
in
cert_status
:
# Note: as of 11/20/2012, we know there are students in this state-- cs169.1x,
# who need to be regraded (we weren't tracking 'notpassing' at first).
# We can add a log.warning here once we think it shouldn't happen.
return
default_status
else
:
d
[
'
grade
'
]
=
cert_status
[
'
grade
'
]
return
d
...
...
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