Example #1
0
def emails_listing(request,option=None):
    """
    Generate Email 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_email_csv(request)
    return generate_email_jtable(request, option)
Example #2
0
def emails_listing(request,option=None):
    """
    Generate Email Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    user = request.user

    if not user.has_access_to(EmailACL.READ):
        return render(request, 'error.html',
                                  {'error':'User does not have permission to delete email.'})

    if option == "csv":
        return generate_email_csv(request)
    return generate_email_jtable(request, option)