Commit 32f9f631 by Bridger Maxwell

Removed accidental duplicate of certificate request view.

parent 1896372c
...@@ -219,36 +219,3 @@ def index(request, course="6.002 Spring 2012", chapter="Using the System", secti ...@@ -219,36 +219,3 @@ def index(request, course="6.002 Spring 2012", chapter="Using the System", secti
result = render_to_response('courseware.html', context) result = render_to_response('courseware.html', context)
return result return result
def certificate_request(request):
''' Attempt to send a certificate. '''
if request.method != "POST":
raise Http404
verification_checked = request.POST.get('cert_request_verify', 'false')
destination_email = request.POST.get('cert_request_email', '')
error = ''
if verification_checked != 'true':
error += 'You must verify that you have followed the honor code to receive a certificate. '
# TODO: Check e-mail format is correct.
if len(destination_email) < 5:
error += 'Please provide a valid email address to send the certificate. '
grade = None
if len(error) == 0:
student_gradesheet = grades.grade_sheet(request.user)
grade = student_gradesheet['grade']
if not grade:
error += 'You have not earned a grade in this course. '
if len(error) == 0:
# TODO: Send the certificate email
return HttpResponse(json.dumps({'success':True,
'value': 'A certificate is being generated and will be sent. ' }))
else:
return HttpResponse(json.dumps({'success':False,
'error': error }))
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