Commit d1cb80a0 by John Jarvis

Merge pull request #291 from edx/jarv/fix-certificates-race-cond

save the cert record immediately after we set the status
parents 189fc894 f6d7cc55
......@@ -194,6 +194,7 @@ class XQueueCertInterface(object):
# on the queue
if self.restricted.filter(user=student).exists():
cert.status = status.restricted
cert.save()
else:
contents = {
'action': 'create',
......@@ -202,15 +203,15 @@ class XQueueCertInterface(object):
'name': profile.name,
}
cert.status = status.generating
cert.save()
self._send_to_xqueue(contents, key)
cert.save()
else:
cert_status = status.notpassing
cert.grade = grade['percent']
cert.status = cert_status
cert.user = student
cert.course_id = course_id
cert.name = profile.name
cert.status = cert_status
cert.save()
return cert_status
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment