Bravo's Southern Charm stars Kathryn Dennis and Thomas Ravenel are getting joint custody of their two kids, Kensie, 5, and Saint 3. The two have been embroiled in a long and messy battle over the children.

Stars of Southern Charm - a reality TV show about socialites living in South Carolina - Dennis and Ravenel have been in the middle of an ongoing custody battle for their two kids. Dennis previously lost custody of Kensie and Saint after failing a drug test and entering rehab in 2016, and then attempted to strip Ravenel of his custody after he was charged with assault and battery last year. While Dennis has been sober and splitting custody with Ravenel, just a few weeks ago, Ravenel requested that the court strip her custody, alleging she'd failed a drug test. He claimed she tested positive for marijuana, benzodiazepines, and amphetamines while the kids were in her care. Dennis contested this, claiming that she passed the hair test, and her mother also showed her support, claiming that Dennis and her children had a great relationship. Now, a court has granted Dennis and Ravenel temporary shared custody.

Related: Southern Charm: Kathryn Violates Court Order, Lets BF Sleep Over with Kids Home

It looks like things between Dennis and Ravenel have reached a calming point, as the two now have temporary joint custody of their two children, according to People. Following a hearing in South Carolina, a judge ruled that the couple could share custody of the kids, but that Ravenel would be the children’s primary legal custodian, Ravenel’s attorney, Kelley Andrews-Edwards, told People. He will be in charge of making any important decisions for Kensie and Saint and will have them "every other long weekend with a midweek overnight." Before the hearing, the couple had custody of the kids on a "week on week off" basis.

In addition, Dennis will be required to undergo cognitive behavioral therapy and will be allowed unsupervised visits with Kensie and Saint. Despite Ravenel making all of the important decisions concerning the kids, Dennis and Ravenel will be ordered to go to co-parenting sessions and are required to work together on health issues and education for the children. This current deal is only temporary, however, and a judge will make a final custody decision at a future date.

Both doting parents continue to share photos and videos of themselves with their kids on social media, and everyone appears to be doing well. Hopefully, Dennis and Ravenel will be able to reconcile and put aside their differences for the sake of their children. It's been a long, hard road for the couple, and this is a good step toward some stability for the family.

Next: Southern Charm: Kathryn's Mom Claims Thomas Drugged Her Daughter

Source: People