Preheat the oven to gas 6, 200°C, fan 180°C. Use the pastry to line a 23cm (9in) fluted tart tin with removable base. Prick the base with a fork and line with nonstick baking paper and baking beans. Blind bake for 12 minutes. Remove paper and beans and bake for a further 5 minutes. Turn down the oven to gas 3, 170°C, fan 150°C.
Fry the onion in 1 tbsp olive oil until softened. Add the bacon and garlic and fry for 5 minutes. Add the courgette and cook for 5 minutes more.
Beat the eggs in a bowl, mix in the cream and season. Put the courgette mix into the tart case, then pour over the egg mixture. Finish with the cheese and bake for 20 minutes. Turn up the oven to gas 6, 200°C, fan 180°C and bake for a final 5 minutes.