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
588a4e64
Commit
588a4e64
authored
Jul 27, 2015
by
Zia Fazal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate verify_uuid for web based certificates also
parent
0f94910d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
lms/djangoapps/certificates/queue.py
+7
-1
lms/djangoapps/certificates/tests/test_queue.py
+9
-1
No files found.
lms/djangoapps/certificates/queue.py
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
()
...
...
lms/djangoapps/certificates/tests/test_queue.py
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'
)
...
...
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