@staff_member_required()
def delete_subject(request, subject_id):
    try:
        subject = Subject.objects.get(pk=subject_id)
    except Subject.DoesNotExist:
        return Http404('The subject does not exist')
    if (request.method == 'POST'):
        if (request.POST['choice'] == 'Yes'):
            subject.delete()
            messages.success(request, (('The subject ' + subject.name) + ' was deleted.'))
        return redirect('dataset_details', subject.dataset.id)
    else:
        return render(request, 'annotationweb/delete_subject.html', {'subject': subject})
@staff_member_required()
def delete_subject(request, subject_id):
    try:
        subject = Subject.objects.get(pk=subject_id)
    except Subject.DoesNotExist:
        return Http404('The subject does not exist')
    if (request.method == 'POST'):
        if (request.POST['choice'] == 'Yes'):
            subject.delete()
            messages.success(request, (('The subject ' + subject.name) + ' was deleted.'))
        return redirect('dataset_details', subject.dataset.id)
    else:
        return render(request, 'annotationweb/delete_subject.html', {'subject': subject})