In any suit brought to challenge an action taken or a restriction imposed which is required to be reported pursuant to Section 805, the court shall, at the conclusion of the action, award to a substantially prevailing party the cost of the suit, including a reasonable attorney's fee, if the other party's conduct in bringing, defending, or litigating the suit was frivolous, unreasonable, without foundation, or in bad faith. For the purposes of this section, a defendant shall not be considered to have substantially prevailed when the plaintiff obtains an award for damages or permanent injunctive or declaratory relief. For the purpose of this section, a plaintiff shall not be considered to have substantially prevailed when the plaintiff does not obtain an award of damages or permanent injunctive or declaratory relief.
Ca. Bus. and Prof'l. Code § 809.9