diff --git a/lms/djangoapps/certificates/queue.py b/lms/djangoapps/certificates/queue.py index d4e96f85be..d926035efd 100644 --- a/lms/djangoapps/certificates/queue.py +++ b/lms/djangoapps/certificates/queue.py @@ -164,31 +164,29 @@ class XQueueCertInterface(object): if is_whitelisted or grade['grade'] is not None: - # check to see whether the student is on the - # the embargoed country restricted list - if self.restricted.filter(user=student).exists(): - cert.status = status.restricted - cert.save() - return cert.status - - cert_status = status.generating key = make_hashkey(random.random()) - cert.status = cert_status cert.grade = grade['percent'] cert.user = student cert.course_id = course_id cert.key = key cert.name = profile.name - contents = { - 'action': 'create', - 'username': student.username, - 'course_id': course_id, - 'name': profile.name, - } - - self._send_to_xqueue(contents, key) + # check to see whether the student is on the + # the embargoed country restricted list + # otherwise, put a new certificate request + # on the queue + if self.restricted.filter(user=student).exists(): + cert.status = status.restricted + else: + contents = { + 'action': 'create', + 'username': student.username, + 'course_id': course_id, + 'name': profile.name, + } + cert.status = status.generating + self._send_to_xqueue(contents, key) cert.save() else: cert_status = status.notpassing diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 8ec58a6a28..845880c69f 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -273,7 +273,7 @@ % if cert_status['status'] == 'processing':
- % elif cert_status['status'] in ('generating', 'ready', 'notpassing'): + % elif cert_status['status'] in ('generating', 'ready', 'notpassing', 'restricted'):