I've never tried it and I now live a long way from the sea so probably never will, but it sounds good as a theory. Possibly, even if it didn't work by its smell overcoming the carrot smell, then it would work as a physical barrier, like cabbage collars, to stop the flies finding soil in which to lay their eggs. If it worked with carrots then it would also work with brassicas.
Probably the only way to find out would be to give it a go. You'd have nothing to lose and at the very least you'd gain a bit of fertility.