Yes, the strong smell from marigolds can work to deter a range of pests, including carrot fly, thrips, weevils and midges. This is why marigolds are often interplanted with carrots to protect them.