def METHOD_NAME(request):
    METHOD_NAME = []
    for project in Project.objects.all():
        patches = request.user.profile.todo_patches(project=project)
        if not patches.count():
            continue
        METHOD_NAME.append({'project': project, 'n_patches': patches.count()})
    if len(METHOD_NAME) == 1:
        return HttpResponseRedirect(
            reverse(
                'user-todo',
                kwargs={'project_id': METHOD_NAME[0]['project'].linkname},
            )
        )
    context = {
        'todo_lists': METHOD_NAME,
    }
    return render(request, 'patchwork/todo-lists.html', context)