(b) If the elected official is held liable for an intentional tort other than defamation in such an action, the trier of fact in reaching the verdict shall determine if the act or omission constituting the intentional tort arose from and was directly related to the elected official's performance of his or her official duties.
If the trier of fact determines that the act or omission arose from and was directly related to the elected official's performance of his or her official duties, the public entity shall be liable for the judgment as provided by law. For the purpose of this subdivision, employee managerial functions shall be deemed to arise from, and to directly relate to, the elected official's official duties. However, acts or omissions constituting sexual harassment shall not be deemed to arise from, and to directly relate to, the elected official's official duties.