Files
edx-platform/lms/djangoapps/support/views/certificate.py
M. Zulqarnain 65f79ef9b3 BOM-2365 : pyupgrade on static_templates, staticbook and support apps (#26699)
*pyupgrade on static_templates, staticbook and support apps

This reverts commit 1ec2e797a1.

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-02-25 14:37:09 +05:00

38 lines
1.3 KiB
Python

"""
Certificate tool in the student support app.
"""
from urllib.parse import quote_plus, unquote
from django.utils.decorators import method_decorator
from django.views.generic import View
from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
class CertificatesSupportView(View):
"""
View for viewing and regenerating certificates for users.
This is used by the support team to re-issue certificates
to users if something went wrong during the initial certificate generation,
such as:
* The user's name was spelled incorrectly.
* The user later earned a higher grade and wants it on their certificate and dashboard.
* The user accidentally received an honor code certificate because their
verification expired before certs were generated.
Most of the heavy lifting is performed client-side through API
calls directly to the certificates app.
"""
@method_decorator(require_support_permission)
def get(self, request):
"""Render the certificates support view. """
context = {
"user_filter": unquote(quote_plus(request.GET.get("user", ""))),
"course_filter": request.GET.get("course_id", "")
}
return render_to_response("support/certificates.html", context)