@csrf_exempt
@user_passes_test(is_in_prereg_group)
def approve_draft(request, draft_pk):
    """Approves current draft
    :param request: mostly for user
    :param draft_pk: Unique id for current draft
    :return: DraftRegistrationApproval obj
    """
    draft = get_draft_or_error(draft_pk)

    user = request.user.osf_user
    draft.approve(user)
    update_admin_log(
        request.user.id, draft._id, 'Draft Registration',
        'approved', action_flag=ACCEPT_PREREG
    )
    return redirect(reverse('pre_reg:prereg') + "?page={0}".format(request.POST.get('page', 1)), permanent=True)
dataset/ETHPy150Open CenterForOpenScience/osf.io/admin/pre_reg/views.py/approve_draft/original