If Code Enforcement "red tagged" the rental dwelling, then the usual 30 or 60 day notice is not required.
If the rental property did not have a permit, then the landlord is not entitled to collect rent. and cannot get a money judgment for the allegedly unpaid rent. The California Court of Appeal case which ruled on this issue is Espinoza v. Calva (2008) 169 Cal.App.4th 1393.
In a "red tag" situation, many cities and counties in California have local ordinances that require relocation assistance for displaced tenants at the expense of the landlord.
Frank W. Chen has been licensed to practice law in California since 1988. The information presented here is general in nature and is not intended, nor should be construed, as legal advice for a particular case. This posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, consult with your own attorney.