You completely got your point across, but I would put it like this: "Until the levy was built the river constantly threatened the population of the village with flooding" Or "Until the levy was built the river was a constant flood threat to the population of the village"
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.