def getGuestList(request):
if not (<EOL>request.method == '<STR_LIT:POST>' and<EOL>request.POST.get('<STR_LIT>') and<EOL>request.POST.get('<STR_LIT>') and<EOL>request.user.is_authenticated and<EOL>request.user.has_perm('<STR_LIT>')<EOL>):<EOL><INDENT>return JsonResponse({})<EOL><DEDENT>guestList = GuestList.objects.filter(id=request.POST.get('<STR_LIT>')).first()<EOL>event = Event.objects.filter(id=request.POST.get('<STR_LIT>')).first()<EOL>if not guestList or not event:<EOL><INDENT>return JsonResponse({})<EOL><DEDENT>return JsonResponse({<EOL>'<STR_LIT>': guestList.getListForEvent(event),<EOL>})<EOL>
This function handles the filtering of available eventregistration-related
invoice items and is used on the revenue reporting form.