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
b5400aa7
Commit
b5400aa7
authored
Jan 20, 2016
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Ensure old audit certs don't get marked ineligible."
This reverts commit
54c349b4
.
parent
d0694aac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
36 deletions
+4
-36
lms/djangoapps/certificates/queue.py
+3
-4
lms/djangoapps/certificates/tests/test_queue.py
+1
-32
No files found.
lms/djangoapps/certificates/queue.py
View file @
b5400aa7
...
@@ -279,7 +279,7 @@ class XQueueCertInterface(object):
...
@@ -279,7 +279,7 @@ class XQueueCertInterface(object):
if
forced_grade
:
if
forced_grade
:
grade
[
'grade'
]
=
forced_grade
grade
[
'grade'
]
=
forced_grade
cert
,
created
=
GeneratedCertificate
.
eligible_certificates
.
get_or_create
(
user
=
student
,
course_id
=
course_id
)
cert
,
__
=
GeneratedCertificate
.
eligible_certificates
.
get_or_create
(
user
=
student
,
course_id
=
course_id
)
cert
.
mode
=
cert_mode
cert
.
mode
=
cert_mode
cert
.
user
=
student
cert
.
user
=
student
...
@@ -290,9 +290,8 @@ class XQueueCertInterface(object):
...
@@ -290,9 +290,8 @@ class XQueueCertInterface(object):
# If this user's enrollment is not eligible to receive a
# If this user's enrollment is not eligible to receive a
# certificate, mark it as such for reporting and
# certificate, mark it as such for reporting and
# analytics. Only do this if the certificate is new -- we
# analytics.
# don't want to mark existing audit certs as ineligible.
if
not
is_eligible_for_certificate
:
if
created
and
not
is_eligible_for_certificate
:
cert
.
eligible_for_certificate
=
False
cert
.
eligible_for_certificate
=
False
cert
.
status
=
CertificateStatuses
.
auditing
cert
.
status
=
CertificateStatuses
.
auditing
cert
.
save
()
cert
.
save
()
...
...
lms/djangoapps/certificates/tests/test_queue.py
View file @
b5400aa7
...
@@ -30,7 +30,7 @@ from certificates.models import (
...
@@ -30,7 +30,7 @@ from certificates.models import (
CertificateStatuses
,
CertificateStatuses
,
)
)
from
certificates.queue
import
XQueueCertInterface
from
certificates.queue
import
XQueueCertInterface
from
certificates.tests.factories
import
CertificateWhitelistFactory
,
GeneratedCertificateFactory
from
certificates.tests.factories
import
CertificateWhitelistFactory
from
lms.djangoapps.verify_student.tests.factories
import
SoftwareSecurePhotoVerificationFactory
from
lms.djangoapps.verify_student.tests.factories
import
SoftwareSecurePhotoVerificationFactory
...
@@ -205,37 +205,6 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
...
@@ -205,37 +205,6 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
else
:
else
:
self
.
assertFalse
(
mock_send
.
called
)
self
.
assertFalse
(
mock_send
.
called
)
def
test_old_audit_cert_eligible
(
self
):
"""
Test that existing audit certificates remain eligible even if cert
generation is re-run.
"""
# Create an existing audit enrollment and certificate
CourseEnrollmentFactory
(
user
=
self
.
user_2
,
course_id
=
self
.
course
.
id
,
is_active
=
True
,
mode
=
CourseMode
.
AUDIT
,
)
GeneratedCertificateFactory
(
user
=
self
.
user_2
,
course_id
=
self
.
course
.
id
,
grade
=
'1.0'
,
status
=
CertificateStatuses
.
downloadable
,
mode
=
GeneratedCertificate
.
MODES
.
audit
,
eligible_for_certificate
=
True
,
)
# Run grading/cert generation again
with
patch
(
'courseware.grades.grade'
,
Mock
(
return_value
=
{
'grade'
:
'Pass'
,
'percent'
:
0.75
})):
with
patch
.
object
(
XQueueInterface
,
'send_to_queue'
)
as
mock_send
:
mock_send
.
return_value
=
(
0
,
None
)
self
.
xqueue
.
add_cert
(
self
.
user_2
,
self
.
course
.
id
)
self
.
assertTrue
(
GeneratedCertificate
.
objects
.
get
(
user
=
self
.
user_2
,
course_id
=
self
.
course
.
id
)
.
eligible_for_certificate
# pylint: disable=no-member
)
@attr
(
'shard_1'
)
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
...
...
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