Preheat the oven to 190°C.
Slice the chorizo into 2 cm pieces.Slice the peppers into strips.Peel the onions, cut them into wedges.
Place the chicken legs in a large baking tray. Scatter the sliced vegetables, chorizo and bay leaves around them. Season with salt & pepper, sprinkle the thyme leaves and chilli flakes (if used) all over, then drizzle with olive oil.
Bake for 20 minutes, then pour over the wine. Bake for another another 20-30 minutes, until the chicken is golden brown (and cooked through!).
Serve war with side dishes of your choice.