After months of their landlord’s failure to comply with basic safety requirements — fundamental things like providing smoke detectors and a functional, reliable sprinkler system — the residents of the Georgia Apartments are being forced out of their homes.

The city has worked nonprofit groups to resettle the displaced tenants in a suitable and safe situation.

The red-tag order on the Georgia Apartments was, gratefully, a rare and extreme step to protect tenants and, according to city inspection reports, it was the culmination of two years of efforts by building and fire inspectors to get the owner to bring the units up to code.

Since 2016, inspectors had responded to complaints that smoke detectors were not functional, that one unit had a fire, and units continually were left without heat in the dead of winter.

This unfortunate story is the predictable outcome of actions by Utah legislators who have worked in tandem with the Utah Apartment Association (UAA) to undermine the ability of municipalities to compel landlords to take even the most basic steps to ensure renters aren’t stuck living in unsafe conditions.

Back in the day, the city would inspect properties once a year. But then in 1997, the Legislature restricted inspections to no more than once every three years, unless there was a reason to believe a violation existed.

Then in 2012, city authority was restricted even further, with the Legislature blocking cities from inspecting buildings unless they had permission from the building owners. In just the first few months after that law took effect, 28 building owners with properties totaling 1,200 units refused to allow inspectors onto their property, according to city records.

In 2015, after years of squabbling, the UAA made a deal with Salt Lake City to permit inspections for “cause or complaint,” but it limited how many units could be inspected during any visit.

This year, state Sen. Lincoln Fillmore is sponsoring SB107, which would only allow cities to enforce nuisance ordinances if they are notified by the resident or the property owner. But that would rule out neighbor complaints.

What you can see is an erosion of the cities’ ability to conduct a fundamental service to tenants, to the point that, unless a tenant complains — as those in the Georgia Apartments did repeatedly — the city cannot initiate inspections.

In this rental market, with apartments scarce and prices high, a tenant takes a significant risk in reporting a problem. Retaliatory eviction is illegal but difficult to prove in court.

And when problems are found, the city has few tools to force a landlord to fix the issue, as the record with the Georgia Apartments clearly illustrates.

In July 2016, a fire in the building gutted one unit to the studs. There was another fire this past August.

There were reports of broken windows and doors. Units unfit to rent were being broken into and appeared to be occupied by transients. There were electrical problems and complaints of mice. The owner was warned about broken-down vehicles in the parking lot.

During a visit last October, the inspector was unable to get into one unit closed due to the fire because between 15 and 20 people were “camping” in the hallway. “Upon inspection, the violations continue and there has been very little progress toward compliance,” inspector Jorge Zavala wrote the following month.

The property owner, Carol Lunt, apparently refused to accept certified letters ordering her to fix the problems and notifying her the city would impose fines. Eventually, the city started racking up fines, anyway, but it didn’t get results.

In his December visit, Zavala noted that the fire department was considering shutting down the building because of continued violations and safety concerns. That, of course, is ultimately what happened Monday when the red-tag notice was given and tenants were given 72 hours to vacate. That was amended Wednesday and now they have to be out by Saturday.

It never should have come to this point. Municipalities all over the state need more tools to make deadbeat slumlords fix long-standing problems. Lawmakers should take this opportunity to strengthen — not weaken — cities’ ability to protect the safety and welfare of residents.