(a) Except as provided in [[Section 7031(e)|subdivision (e)]], no person engaged in the business or acting in the capacity of a contractor, may bring or maintain any action, or recover in law or equity in any action, in any court of this state for the collection of compensation for the performance of any act or contract where a license is required by this chapter without alleging that they were a duly licensed contractor at all times during the performance of that act or contract regardless of the merits of the cause of action brought by the person, except that this prohibition shall not apply to contractors who are each individually licensed under this chapter but who fail to comply with Section 7029.