Cal. Gov't Code § 12926.05
(b) If an individual specified in subdivision (a) brings an action against an employer for any form of harassment or discrimination prohibited by this part, the employer has an affirmative defense to the action by proving, by a preponderance of evidence, both of the following: