certificate.py 1.29 KB
Newer Older
1 2 3
"""
Certificate tool in the student support app.
"""
4 5
import urllib

6
from django.utils.decorators import method_decorator
7
from django.views.generic import View
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

from edxmako.shortcuts import render_to_response
from 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 his/her certificate and dashboard.
    * The user accidentally received an honor code certificate because his/her
        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 = {
35
            "user_filter": urllib.unquote(urllib.quote_plus(request.GET.get("user", ""))),
asadiqbal committed
36
            "course_filter": request.GET.get("course_id", "")
37 38
        }
        return render_to_response("support/certificates.html", context)