

@login_required
@require_POST
def team_accept(request, pk):
    membership = get_object_or_404(Membership, pk=pk)
    if membership.accept(by=request.user):
        messages.success(request, MESSAGE_STRINGS['accepted-application'])
    return redirect('team_detail', slug=membership.team.slug)

dataset/ETHPy150Open pinax/pinax-teams/pinax/teams/views.py team_accept/original