Commit 68c747c8 by Bridger Maxwell

Added check to make sure certificate can only be requested by active student.

parent 41c6d310
......@@ -94,7 +94,7 @@ def certificate_request(request):
def generate_certificate(user, grade):
# Make sure to see the comments in models.GeneratedCertificate to read about the valid
# states for a GeneratedCertificate object
if grade:
if grade and user.is_active:
generated_certificate = None
try:
......@@ -130,4 +130,4 @@ def generate_certificate(user, grade):
res=send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email,])
else:
log.warning("Asked to generate a certificate for student " + str(user.username) + " but without a grade.")
log.warning("Asked to generate a certificate for student " + str(user.username) + " but with a grade of " + str(grade) + " and active status " + str(user.is_active))
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