def certificates_listing(request,option=None): """ Generate Certificate Listing template. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param option: Whether or not we should generate a CSV (yes if option is "csv") :type option: str :returns: :class:`django.http.HttpResponse` """ request.user._setup() user = request.user if user.has_access_to(CertificateACL.READ): if option == "csv": return generate_cert_csv(request) elif option== "jtdelete" and not user.has_access_to(CertificateACL.DELETE): result = {'sucess':False, 'message':'User does not have permission to delete Certificate.'} return HttpResponse(json.dumps(result, default=json_handler), content_type="application/json") return generate_cert_jtable(request, option) else: return render(request, "error.html", {'error': 'User does not have permission to view Certificate listing.'})
def certificates_listing(request, option=None): """ Generate Certificate Listing template. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param option: Whether or not we should generate a CSV (yes if option is "csv") :type option: str :returns: :class:`django.http.HttpResponse` """ request.user._setup() user = request.user if user.has_access_to(CertificateACL.READ): if option == "csv": return generate_cert_csv(request) elif option == "jtdelete" and not user.has_access_to( CertificateACL.DELETE): result = { 'sucess': False, 'message': 'User does not have permission to delete Certificate.' } return HttpResponse(json.dumps(result, default=json_handler), content_type="application/json") return generate_cert_jtable(request, option) else: return render_to_response("error.html", { 'error': 'User does not have permission to view Certificate listing.' }, RequestContext(request))
def certificates_listing(request,option=None): """ Generate Certificate Listing template. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param option: Whether or not we should generate a CSV (yes if option is "csv") :type option: str :returns: :class:`django.http.HttpResponse` """ if option == "csv": return generate_cert_csv(request) return generate_cert_jtable(request, option)
def certificates_listing(request, option=None): """ Generate Certificate Listing template. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param option: Whether or not we should generate a CSV (yes if option is "csv") :type option: str :returns: :class:`django.http.HttpResponse` """ if option == "csv": return generate_cert_csv(request) return generate_cert_jtable(request, option)