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
b5c32ec4
Commit
b5c32ec4
authored
Jul 13, 2015
by
Zia Fazal
Committed by
Matt Drayer
Jul 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ziafazal/SOL-980: Fix error while generating certificates
parent
3f432d49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lms/djangoapps/instructor_task/tasks_helper.py
+3
-4
No files found.
lms/djangoapps/instructor_task/tasks_helper.py
View file @
b5c32ec4
...
...
@@ -57,7 +57,6 @@ from opaque_keys.edx.keys import UsageKey
from
openedx.core.djangoapps.course_groups.cohorts
import
add_user_to_cohort
,
is_course_cohorted
from
student.models
import
CourseEnrollment
,
CourseAccessRole
from
verify_student.models
import
SoftwareSecurePhotoVerification
from
util.query
import
use_read_replica_if_available
# define different loggers for use within tasks and on client side
TASK_LOG
=
logging
.
getLogger
(
'edx.celery.task'
)
...
...
@@ -1262,7 +1261,7 @@ def generate_students_certificates(
that are enrolled.
"""
start_time
=
time
()
enrolled_students
=
use_read_replica_if_available
(
CourseEnrollment
.
objects
.
users_enrolled_in
(
course_id
)
)
enrolled_students
=
CourseEnrollment
.
objects
.
users_enrolled_in
(
course_id
)
task_progress
=
TaskProgress
(
action_name
,
enrolled_students
.
count
(),
start_time
)
current_step
=
{
'step'
:
'Calculating students already have certificates'
}
...
...
@@ -1386,7 +1385,7 @@ def students_require_certificate(course_id, enrolled_students):
:param enrolled_students:
"""
# compute those students where certificates already generated
students_already_have_certs
=
use_read_replica_if_available
(
User
.
objects
.
filter
(
students_already_have_certs
=
User
.
objects
.
filter
(
~
Q
(
generatedcertificate__status
=
CertificateStatuses
.
unavailable
),
generatedcertificate__course_id
=
course_id
)
)
generatedcertificate__course_id
=
course_id
)
return
list
(
set
(
enrolled_students
)
-
set
(
students_already_have_certs
))
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