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
eab95114
Commit
eab95114
authored
Jan 23, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1295 from MITx/feature/jarv/certificate-force-update
Feature/jarv/certificate force update
parents
07785e3c
08b8a9f6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
lms/djangoapps/certificates/management/commands/gen_cert_report.py
+0
-5
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
+17
-6
lms/djangoapps/certificates/queue.py
+3
-2
No files found.
lms/djangoapps/certificates/management/commands/gen_cert_report.py
View file @
eab95114
...
...
@@ -16,7 +16,6 @@ class Command(BaseCommand):
This command does not do anything other than report the current
certificate status.
unavailable - A student is not eligible for a certificate.
generating - A request has been made to generate a certificate,
but it has not been generated yet.
regenerating - A request has been made to regenerate a certificate,
...
...
@@ -64,11 +63,7 @@ class Command(BaseCommand):
enrolled_students
=
User
.
objects
.
filter
(
courseenrollment__course_id
=
course_id
)
.
prefetch_related
(
"groups"
)
.
order_by
(
'username'
)
unavailable_count
=
enrolled_students
.
count
()
-
\
GeneratedCertificate
.
objects
.
filter
(
course_id__exact
=
course_id
)
.
count
()
cert_data
[
course_id
]
=
{
'enrolled'
:
enrolled_students
.
count
()}
cert_data
[
course_id
]
.
update
({
'unavailable'
:
unavailable_count
})
tallies
=
GeneratedCertificate
.
objects
.
filter
(
course_id__exact
=
course_id
)
.
values
(
'status'
)
.
annotate
(
...
...
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
View file @
eab95114
...
...
@@ -31,18 +31,29 @@ class Command(BaseCommand):
metavar
=
'COURSE_ID'
,
dest
=
'course'
,
default
=
False
,
help
=
'Grade and generate certificates for a specific course'
),
help
=
'Grade and generate certificates '
'for a specific course'
),
make_option
(
'-f'
,
'--force-gen'
,
metavar
=
'STATUS'
,
dest
=
'force'
,
default
=
False
,
help
=
'Will generate new certificates for only those users '
'whose entry in the certificate table matches STATUS. '
'STATUS can be generating, unavailable, deleted, error '
'or notpassing.'
),
)
def
handle
(
self
,
*
args
,
**
options
):
# Will only generate a certificate if the current
# status is in this state
# status is in the unavailable state, can be set
# to something else with the force flag
VALID_STATUSES
=
[
CertificateStatuses
.
unavailable
]
if
options
[
'force'
]:
valid_statuses
=
getattr
(
CertificateStatuses
,
options
[
'force'
])
else
:
valid_statuses
=
[
CertificateStatuses
.
unavailable
]
# Print update after this many students
...
...
@@ -85,7 +96,7 @@ class Command(BaseCommand):
start
=
datetime
.
datetime
.
now
()
if
certificate_status_for_student
(
student
,
course_id
)[
'status'
]
in
VALID_STATUSES
:
student
,
course_id
)[
'status'
]
in
valid_statuses
:
if
not
options
[
'noop'
]:
# Add the certificate request to the queue
ret
=
xq
.
add_cert
(
student
,
course_id
)
...
...
lms/djangoapps/certificates/queue.py
View file @
eab95114
...
...
@@ -192,7 +192,7 @@ class XQueueCertInterface(object):
Will change the certificate status to 'deleting'.
Certificate must be in the 'unavailable', 'error',
or 'deleted
' state.
'deleted' or 'generating
' state.
If a student has a passing grade a request will made
for a new cert
...
...
@@ -204,7 +204,8 @@ class XQueueCertInterface(object):
"""
VALID_STATUSES
=
[
status
.
unavailable
,
status
.
deleted
,
status
.
error
,
VALID_STATUSES
=
[
status
.
generating
,
status
.
unavailable
,
status
.
deleted
,
status
.
error
,
status
.
notpassing
]
cert_status
=
certificate_status_for_student
(
...
...
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