A federal judge temporarily blocked a newly enacted law in California that would force President Trump to release his tax returns to appear on the primary ballot.

U.S. District Judge Morrison England Jr. said the law likely violates the Constitution. The move is a win for Trump, who sued to block implementation of the law in August.

California Gov. Gavin Newsom, a Democrat, signed the law in July that requires candidates for president and governor to release their personal income tax returns dating back five years to the California secretary of state’s office. If candidates fail to do so, they would not appear on the state’s primary ballot. The law does not apply to general elections.

Trump’s lawyer William Consovoy argued the law violated a candidate’s First Amendment rights.

Morrison wrote in his 24-page ruling that the state’s concerns are “both legitimate and understandable” and that candidates have given “unnecessary and irrelevant excuses for shielding the public from such information.”

“It is not the job of the courts, however, to decide whether a tax return disclosure requirement is good policy or makes political sense,” Morrison wrote. “Instead, it is the court’s job to make sure the Constitution wins.”

“The dangerous precedent set by this act, allowing the controlling party in any state’s legislature to add substantive requirements as a precondition to qualifying for the state’s presidential primary ballot, should concern all candidates alike,” he added.

California Secretary of State Alex Padilla said he would appeal the ruling.

But even if the law holds up, Trump could decide not to compete in the California primary and still win the Republican nomination without the state’s delegates because he thus far has no serious primary challenger.