def events_listing(request, option=None): """ Generate Event 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_event_csv(request) return generate_event_jtable(request, option)
def events_listing(request, option=None): """ Generate Event 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` """ user = request.user if user.has_access_to(EventACL.READ): if option == "csv": return generate_event_csv(request) return generate_event_jtable(request, option) else: return render(request, "error.html", {'error': 'User does not have permission to view Event listing.'})
def events_listing(request, option=None): """ Generate Event 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` """ user = request.user if user.has_access_to(EventACL.READ): if option == "csv": return generate_event_csv(request) return generate_event_jtable(request, option) else: return render( request, "error.html", {'error': 'User does not have permission to view Event listing.'})