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
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
588a4e64
Commit
588a4e64
authored
9 years ago
by
Zia Fazal
Browse files
Options
Downloads
Patches
Plain Diff
generate verify_uuid for web based certificates also
parent
0f94910d
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/certificates/queue.py
+7
-1
7 additions, 1 deletion
lms/djangoapps/certificates/queue.py
lms/djangoapps/certificates/tests/test_queue.py
+9
-1
9 additions, 1 deletion
lms/djangoapps/certificates/tests/test_queue.py
with
16 additions
and
2 deletions
lms/djangoapps/certificates/queue.py
+
7
−
1
View file @
588a4e64
...
...
@@ -4,6 +4,7 @@ import random
import
logging
import
lxml.html
from
lxml.etree
import
XMLSyntaxError
,
ParserError
# pylint:disable=no-name-in-module
from
uuid
import
uuid4
from
django.test.client
import
RequestFactory
from
django.conf
import
settings
...
...
@@ -336,7 +337,12 @@ class XQueueCertInterface(object):
}
if
template_file
:
contents
[
'
template_pdf
'
]
=
template_file
new_status
=
status
.
generating
if
generate_pdf
else
status
.
downloadable
if
generate_pdf
:
new_status
=
status
.
generating
else
:
new_status
=
status
.
downloadable
cert
.
verify_uuid
=
uuid4
().
hex
cert
.
status
=
new_status
cert
.
save
()
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/certificates/tests/test_queue.py
+
9
−
1
View file @
588a4e64
...
...
@@ -22,7 +22,12 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
capa.xqueue_interface
import
XQueueInterface
from
certificates.queue
import
XQueueCertInterface
from
certificates.models
import
ExampleCertificateSet
,
ExampleCertificate
from
certificates.models
import
(
ExampleCertificateSet
,
ExampleCertificate
,
GeneratedCertificate
,
CertificateStatuses
,
)
@attr
(
'
shard_1
'
)
...
...
@@ -64,6 +69,9 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
# Verify that add_cert method does not add message to queue
self
.
assertFalse
(
mock_send
.
called
)
certificate
=
GeneratedCertificate
.
objects
.
get
(
user
=
self
.
user
,
course_id
=
self
.
course
.
id
)
self
.
assertEqual
(
certificate
.
status
,
CertificateStatuses
.
downloadable
)
self
.
assertIsNotNone
(
certificate
.
verify_uuid
)
@attr
(
'
shard_1
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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