Heat the oil in a medium saucepan and gently fry the onion for 4–5 minutes, or until softened and lightly coloured, stirring regularly. Add the ginger, chilli flakes, coriander, cumin and turmeric and cook for a further 2 minutes, stirring constantly. Stir in the tomatoes and salt and bring to a simmer. Cook for 5 minutes more over a medium heat, stirring regularly. Remove from the heat and blend with a stick blender until smooth.
Return to the heat, add the black beans with their liquid, season with a squeeze of lime or lemon juice and more salt if needed, then simmer for another 2–3 minutes, or until the curry is hot, stirring regularly.
