I have looked at the California rental agreement, but I had a few questions.

My situation:
My girlfriend and I moved into a house and signed a contract for a 1 year lease agreement. Due to unforeseen circumstances, we need to move, and have since given a 30-day notice to break our lease. Our contract states that we will forfeit our deposit ($1000) plus a $600 penalty fee. After my girlfriend spoke with the landlord, the landlord stated that we would need to pay for carpet cleaning and repainting of the rooms (since we had painted) in addition to the other charges. The landlord has yet to look at the property. Is this legal?