We classify the Lorentzian manifolds of dimension n ≥ 3 admitting some diagonalizable operators which satisfy the Codazzi equation. This classification is applied to characterize three- dimensional weakly-Einstein Lorentzian manifolds which fall in the conformal class of the flat metrics.