@login_required()
@require_http_methods(["POST"])
def update_type(request):
    event_type = request.POST['event_type']
    event_types = ('acknowledge', 'resolve')
    incident_ids = request.POST.getlist('selection', None)

    if not event_type:
        messages.error(request, 'Invalid event modification!')
        return HttpResponseRedirect(request.POST['url'])
    try:
        if incident_ids:
            _update_type(request.user, incident_ids, event_type)
        else:
            id = request.POST.get('id')
            _update_type(request.user, [id], event_type)
    except Incident.DoesNotExist:
        messages.error(request, 'Incident not found')
        return HttpResponseRedirect(request.POST['url'])
    except __HOLE__ as e:
        messages.error(request, e.messages)
    return HttpResponseRedirect(request.POST['url'])
dataset/ETHPy150Open ustream/openduty/openduty/incidents.py/update_type