Пример #1
0
def delete(request, project_id, family_id):
    project = get_object_or_404(Project, project_id=project_id)
    family = get_object_or_404(Family, project=project, family_id=family_id)
    if not project.can_admin(request.user):
        raise PermissionDenied

    if request.method == 'POST':
        if request.POST.get('confirm') == 'yes':
            sample_management.delete_family(project.project_id, family.family_id)
            return redirect('families', project_id)

    return render(request, 'family/delete.html', {
        'project': project,
        'family': family,
        'new_page_url': '/project/{}/project_page'.format(project.seqr_project.guid) if project.seqr_project else None,
    })
Пример #2
0
def delete(request, project_id, family_id):
    project = get_object_or_404(Project, project_id=project_id)
    family = get_object_or_404(Family, project=project, family_id=family_id)
    if not project.can_admin(request.user):
        raise PermissionDenied

    if request.method == 'POST':
        if request.POST.get('confirm') == 'yes':
            sample_management.delete_family(project.project_id, family.family_id)
            return redirect('families', project_id)

    return render(request, 'family/delete.html', {
        'project': project,
        'family': family,
        'new_page_url': '/project/{}/project_page'.format(project.seqr_project.guid) if project.seqr_project else None,
    })
Пример #3
0
def delete(request, project_id, family_id):
    error = None

    project = get_object_or_404(Project, project_id=project_id)
    family = get_object_or_404(Family, project=project, family_id=family_id)
    if not project.can_admin(request.user):
        return HttpResponse('unauthorized')

    if request.method == 'POST':
        if request.POST.get('confirm') == 'yes':
            sample_management.delete_family(project.project_id, family.family_id)
            return redirect('families', project_id)

    return render(request, 'family/delete.html', {
        'project': project,
        'family': family,
    })
Пример #4
0
def delete(request, project_id, family_id):
    error = None

    project = get_object_or_404(Project, project_id=project_id)
    family = get_object_or_404(Family, project=project, family_id=family_id)
    if not project.can_admin(request.user):
        raise PermissionDenied

    if request.method == 'POST':
        if request.POST.get('confirm') == 'yes':
            sample_management.delete_family(project.project_id, family.family_id)
            return redirect('families', project_id)

    return render(request, 'family/delete.html', {
        'project': project,
        'family': family,
    })