If less than the whole of a district is included in a city either by reason of annexation or by reason of incorporation proceedings, the territory so included within the city shall continue to remain a part of the district for all purposes until a copy of a resolution adopted by the city requesting exclusion of such territory from the district is received by the board. Upon receipt of such a resolution requesting exclusion of the territory contained within the city, such territory shall be excluded from the district and the remaining territory shall continue as a district. But the exclusion of such territory from the district shall not be effective until all outstanding contracts of the districts have expired or the contracts, with the consent of the parties, have been modified or canceled so as to relieve the district of further obligation to pay for future maintenance in the affected territory.