

@csrf_exempt
@user_passes_test(is_in_prereg_group)
def approve_draft(request, draft_pk):
    'Approves current draft\n    :param request: mostly for user\n    :param draft_pk: Unique id for current draft\n    :return: DraftRegistrationApproval obj\n    '
    draft = get_draft_or_error(draft_pk)
    user = request.user.osf_user
    draft.approve(user)
    update_admin_log(draft_pk.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/VarMisuse@47/129 `request`->`draft_pk`