def METHOD_NAME(request):
    """Saves a report subscription"""
    new_address = request.POST.get('new_address')
    period = request.POST.get('period')
    report_type = request.POST.get('report_type')
    exclude_maintenance = bool(request.POST.get('exclude_maintenance'))
    if new_address:
        email_sender = AlertSender.objects.get(name=AlertSender.EMAIL)
        address = AlertAddress(
            account=request.account, type=email_sender, address=new_address
        )
        address.save()
    else:
        address = get_object_or_404(AlertAddress, pk=int(request.POST.get('address')))
    ReportSubscription(
        account=request.account,
        address=address,
        period=period,
        exclude_maintenance=exclude_maintenance,
        report_type=report_type,
    ).save()
    return HttpResponse()