Doug Jones caught lightning — and a large amount of Republican incompetence — in a bottle on Tuesday. Does that mean that Democrats have gained a foothold in Alabama? The Atlantic’s McKay Coppins warns that the days of reliable red-state results from this bastion of Republican dominance may be numbered, especially if the party continues to choose candidates like Roy Moore.

Unfortunately, as Coppins points out, the track record of learning this lesson is grim:

While Republicans in the political class will no doubt cite Moore’s loss as proof that their party needs to nominate stronger, more mainstream candidates next year, it’s far from certain that primary voters on the ground will heed such pleas from the swamp.

“What’s the lesson here?” one GOP consultant asked me on the eve of the Alabama election, on condition of anonymity so as to speak with candor. “Don’t entrust our nominations to loose cannons? We’ve been fighting this battle since 2010 and no one learns anything from it. Did we not learn that from Christine O’Donnell? Did we not learn that from Sharon Angle?”

Indeed, this is not the first time in recent memory that Republicans have coughed up an easy win by handing their nomination to a loose cannon. While the Tea Party wave of 2010 swept dozens of GOP lawmakers into office—including some future party stars like Senators Marco Rubio and Rand Paul—it also produced several decidedly terrible candidates who lost races that were well within reach for the Republican Party.

Angle, for example, waged a strange and reckless campaign in Nevada and ultimately blew a chance to unseat Democratic Senator Harry Reid. Her candidacy would be remembered primarily for her claim—instantly debunked, and nationally ridiculed—that the threat of encroaching Sharia Law constituted a “militant terrorist situation” in the cities of Dearborn, Michigan, and Frankford, Texas. Meanwhile, O’Donnell (who is most famous for her “I am not a witch” campaign ad) defeated a former governor and nine-term congressman in the Republican primary, and then got blown out in the general.

Coppins doesn’t mention two other examples, perhaps even better in their own ways. Richard Mourdock took down a safe Republican incumbent in Indiana, Richard Lugar, in the primaries only to blow up in the general election by fumbling an answer on abortion (which the media unfairly magnified into something it wasn’t, to be fair). Even worse, however, was the nomination of Todd Akin as Claire McCaskill’s challenger in Missouri the same year. McCaskill elevated Akin among a group of Republicans in order to get him as her general election candidate, and then won an election the GOP should have won when Akin made a much worse fumble on abortion. Akin tried to parse a question about abortion exceptions for rape by claiming that pregnancies from “legitimate rape” were “really rare”:

Well you know, people always want to try to make that as one of those things, well how do you, how do you slice this particularly tough sort of ethical question. First of all, from what I understand from doctors, that’s really rare. If it’s a legitimate rape, the female body has ways to try to shut that whole thing down.

Akin later apologized, but the media challenged every Republican in the field on their views on whether there was any such thing as “legitimate rape.” At any rate, Republicans may have picked up the Rubio and Paul seats with grassroots-conservative candidates, but they may have given away as many as five other Senate seats over the last seven years with these kinds of amateurish candidates, a margin which the GOP would dearly love to have at the moment.

At the Washington Examiner, James Antle argues that Jones will be another Scott Brown — someone who won a special election because of a bad candidate and a unique set of circumstances:

Democrats would like to see Jones’ narrow defeat of embattled Republican Roy Moore as a harbinger of 2018 success, as voters rise up against President Trump, who is ending his first year in office with historically low approval ratings. Democrats have seen the House as being in play for months and Jones’ election improves their odds in the Senate, despite an electoral map for the upper chamber next year that will be very favorable to Republicans.

The parallels are obvious: The party in power blew what should have been winnable Senate races in states where they were heavily favored. Obama had received nearly 62 percent of the vote in Massachusetts in 2008. Trump did slightly better in Alabama last year.

Brown was elected to take the seat that once belonged to Ted Kennedy, the liberal “Lion of the Senate,” filling the remainder of his term. Kennedy died in 2009. Jones is taking the seat vacated by Jeff Sessions, an exponent of Trump-style conservatism with an emphasis on borders, immigration control, national sovereignty, and economic populism before Trump. Sessions resigned to be attorney general.

Both races took place against the backdrop of activist energy against the party in the White House. Brown was buoyed by the Tea Party on the Right, Jones was somewhat more quietly linked to the Resistance on the Left.

It will be interesting to see how far Jones plays to the Right to protect himself over the next three years. Does he vote for Trump’s judicial nominees, for instance, or does he join the Democratic blockade? That will be the biggest tell for Alabama voters, who will turn out in normal numbers for the 2020 election when Jones’ term is up, but it’s a trap either way. If he votes with Trump’s appointees, the progressive base will shred him; if he doesn’t, he’ll manage 35% of the vote when Republicans nominate a competitive candidate.

Assuming that they do, however, is still a leap of faith after this debacle. In my column for The Week, I argue that there’s still plenty of silver lining in this outcome, but it depends on Republican voters learning the lessons of this disaster and all the others that preceded it:

What can be learned from this debacle? First and foremost, to paraphrase Mark Twain: The reports of the death of character in politics was greatly exaggerated. Trump’s win over Clinton last year supposedly demonstrated that a fighting spirit trumps character, so to speak, but that arguably misreads what took place in the 2016 cycle. Both candidates had character issues, which tended to cancel each other out, not lessen their importance overall. When a candidate with serious character issues runs against another without that kind of baggage, it’s going to make a big difference — even bigger, in this case, than Jones’ liberal pro-choice position on abortion. That is a lesson Democrats should take for the 2020 presidential race, and one which Republicans had better consider, too.

Populism still matters, but the focus of that populism matters more. Trump hit the familiar culture-war tropes in his campaign but focused most intently on economic populism. He bonded with working-class Americans on trade protection, immigration crackdowns, and job creation. Strange and Brooks could have done the same in Alabama, but Moore seemed much more focused on culture-war signaling, which clearly didn’t excite the Republican base to turn out enough to rescue Moore from the voters he was alienating. Having campaign surrogates go on television to explain why homosexuality should be made illegal and why pregnant news anchors should fear Jones’ thirst for abortions doesn’t work in 2017, at least not in general elections. Not even, it seems, in Alabama.

Finally, the election proves that running against the “establishment” isn’t necessarily going to capture the imagination of voters, especially when it comes to fighting on the basis of personalities. Voters want to know how candidates will improve their lives, not how they’ll fight Mitch McConnell. While social media platforms amplify this kind of partisan and internecine sniping, most voters don’t obsess over politics enough to care. They want government that works well where it should and stays out of everything else. Even Trump’s talk about the “swamp” was framed to argue that he alone could drain it and deliver on the life-improving economic promises he made on the campaign trail.

And this silver lining is especially important:

Moore’s loss might provide the GOP a silver lining. Had he been even a little more competent, Moore might have managed to eke out a win, leaving this seat vulnerable again in 2020 — and burdening Senate Republicans and President Trump with trying to explain their cynical backing of Moore every day between now and then. This loss is temporary anyway. Republicans won a Senate seat in deep-blue Massachusetts in a 2009 special election thanks to a combination of grassroots enthusiasm and an incompetent Democratic candidate, but Scott Brown couldn’t hold it in the following election. Jones is almost certain to face the same fate if Republicans manage to find an even marginally more competent candidate in a general election cycle; Moore’s loss will mean that an incumbent won’t disincentivize talented candidates from jumping into a primary.

All the GOP needs to do is wake up to the need to choose their candidates wisely.