@staff_member_required()
def delete_sequence(request, sequence_id):
    try:
        sequence = ImageSequence.objects.get(pk=sequence_id)
    except ImageSequence.DoesNotExist:
        return Http404('The sequence does not exist')
    if (request.method == 'POST'):
        if (request.POST['choice'] == 'Yes'):
            sequence.delete()
            messages.success(request, (('The subject ' + sequence.format) + ' was deleted.'))
        return redirect('subject_details', sequence.subject.id)
    else:
        return render(request, 'annotationweb/delete_sequence.html', {'sequence': sequence})
@staff_member_required()
def delete_sequence(request, sequence_id):
    try:
        sequence = ImageSequence.objects.get(pk=sequence_id)
    except ImageSequence.DoesNotExist:
        return Http404('The sequence does not exist')
    if (request.method == 'POST'):
        if (request.POST['choice'] == 'Yes'):
            sequence.delete()
            messages.success(request, (('The subject ' + sequence.format) + ' was deleted.'))
        return redirect('subject_details', sequence.subject.id)
    else:
        return render(request, 'annotationweb/delete_sequence.html', {'sequence': sequence})