def resolve(request, draftmodel, choicemodel):
    if draftmodel is DraftAuthority:
        # We're doing this the hard way, and "manually" handling the cleaned
        #  form data.
        resolve_update_authority(request)
    elif draftmodel is DraftCitation:
        resolve_update_citation(request)

    for field in request.POST.keys():
        if not field.startswith('merge'):
            continue

        draftinstance_id = int(field.split('_')[-1])
        choice_id = request.POST.get(field, None)

        draftinstance = draftmodel.objects.get(pk=draftinstance_id)

        if draftinstance.processed:
            continue
        choice_instance = choicemodel.objects.get(pk=choice_id)

        irEvent = InstanceResolutionEvent(
            for_instance=draftinstance,
            to_instance=choice_instance,
        )
        irEvent.save()

        draftinstance.processed = True
        draftinstance.save()
Perform a draft -> production merge for all instances indicated by the
dataset/ETHPy150Open upconsulting/IsisCB/isiscb/zotero/admin.py/resolve