예제 #1
0
파일: projects.py 프로젝트: dgholz/sentry
def edit_project_member(request, project, member_id):
    try:
        member = project.member_set.get(pk=member_id)
    except ProjectMember.DoesNotExist:
        return HttpResponseRedirect(reverse('sentry-manage-project', args=[project.pk]))

    result = plugins.first('has_perm', request.user, 'edit_project_member', member)
    if result is False and not request.user.has_perm('sentry.can_change_projectmember'):
        return HttpResponseRedirect(reverse('sentry'))

    form = EditProjectMemberForm(project, request.POST or None, instance=member)
    if form.is_valid():
        member = form.save(commit=True)

        return HttpResponseRedirect(request.path + '?success=1')

    context = csrf(request)
    context.update({
        'member': member,
        'project': project,
        'form': form,
        'dsn': member.get_dsn(),
    })

    return render_to_response('sentry/projects/members/edit.html', context, request)
예제 #2
0
def edit_project_member(request, project, member_id):
    member = project.member_set.get(pk=member_id)

    form = EditProjectMemberForm(project, request.POST or None, instance=member)
    if form.is_valid():
        member = form.save(commit=True)

        return HttpResponseRedirect(request.path + '?success=1')

    context = csrf(request)
    context.update({
        'member': member,
        'project': project,
        'form': form,
    })

    return render_to_response('sentry/projects/members/edit.html', context, request)
예제 #3
0
def edit_project_member(request, project, member_id):
    member = project.member_set.get(pk=member_id)

    form = EditProjectMemberForm(project,
                                 request.POST or None,
                                 instance=member)
    if form.is_valid():
        member = form.save(commit=True)

        return HttpResponseRedirect(request.path + '?success=1')

    context = csrf(request)
    context.update({
        'member': member,
        'project': project,
        'form': form,
    })

    return render_to_response('sentry/projects/members/edit.html', context,
                              request)