No judgment can be entered on the confession of the parties, or either of them, or if it appear that adultery was committed by either, with the consent of the other, for the purpose of obtaining a divorce, or where both parties have committed adultery, or where there has been a condonation of adultery by the admission of the offending party to conjugal embraces after knowledge of the commission of the crime, or when the husband knew of or connived at the adultery of the wife.
Ala. Code § 30-2-3 (1975)