This would be an absolute no for me, kids or not.
The reason for the affair wouldn't matter. This is their nature when the going gets tough and they'd have had to lie to me to carry it out.
I also wouldn't trust any attempts on their part to fix it either. It's not that difficult for them to take steps/measures to try and prove they'd never do it again and rebuild your trust...but as they are a liar by the very fact they had an affair at all, it's likely pretense. Been there, divorced that.
And how would I know they're not just putting on this act to 'save the marriage' solely because they don't want to be kicked out of the house, pay child maintenance etc?
I'm speaking from my own experience, it's how my exH was. It was all an act, he repeated the behaviour after a period of faking.
I left for my kids so they didn't have to be exposed to the effects of a permanently damaged relationship and for them to have a happy and healthy mom. Best decision I ever made, hard as it was.
But everyone has to navigate their own feelings, what they believe is true and ultimately what is best for you. Don't factor anything else in. Kids will adapt if you break up. Decide based on what you can live with for yourself/how you feel.