(CNN) To hear officials say it, Sutherland Springs shooter Devin Kelley should never have been able to buy a gun . He was court-martialed for assault on his wife and assault on their child while serving in the Air Force. He received a bad conduct discharge some time after. Now, the Air Force is acknowledging that the convictions were not properly transferred to the law enforcement database that would have allowed then to show up on an background check.

Because of this, and some particularities of Texas gun laws, Kelley was able to purchase the rifle he used in the shooting from a sporting goods store in San Antonio in April 2016.

Here's a closer look at the laws surrounding owning and carrying a gun in Texas.

Texas has no assault weapons legislation

Like most states, Texas does not have an assault weapons ban in place. After the federal assault weapons ban expired in 2004, only seven states and the District of Columbia instated assault weapons bans , and two other states have regulations but not bans.

You need a license to carry a handgun on you, but not a long gun

In Texas, you do not need a permit to buy a handgun or a long gun . You also are not required to register firearms with the state, and you are not required to be licensed as an owner.

Texas has a very specific set of regulations on who can and cannot be licensed to carry a handgun.

According to the Texas Department of Public Safety, a person can be rendered ineligible for several reasons, including the conviction of a felony or Class A or Class B misdemeanor "or equivalent offense."

According to Abbott, the Texas Department of Public Safety indicated Kelley applied for, and was denied, a license to carry a handgun . However, according to state laws , just because you do not have a license to carry a handgun does not mean you can't purchase or possess one under federal law.

Kelley bought four weapons in total -- two in Colorado and two in Texas, the ATF said. One each was purchased in 2014, 2015, 2016 and 2017. Two handguns were found in the shooter's vehicle. A Ruger AR-556 rifle was found in front of the church where Kelley dropped it when a local resident rushed him.

While handgun licenses are a regulated part of Texas law, you do not need a license to carry a long gun, the gun that Kelley fired into the church. Moreover, there is no provision in the Texas Penal Code that prohibits carrying a long gun in public.

JUST WATCHED What happened to bump stock legislation? Replay More Videos ... MUST WATCH What happened to bump stock legislation? 01:45

You do need to pass a background check

There is no waiting period for purchasing firearms in Texas, but you do need to pass a background check. In some states, a background check can be run fairly quickly through the National Instant Criminal Background Check System (NICS). However, Texas is not one of these states, so firearms dealers are required to contact the FBI directly for all firearm background checks

The Gun Control Act prohibits the "transfer of a firearm" (which can be a sale) to people with certain criminal or personal history. Among the things that can keep you from getting a gun: A conviction of a crime "punishable by imprisonment for more than 1 year," restraining orders pertaining to "an intimate partner or child," a conviction of a "misdemeanor crime of domestic violence," or a dishonorable discharge from the US Armed Forces.

JUST WATCHED Neighbor saw shooting, held young survivor Replay More Videos ... MUST WATCH Neighbor saw shooting, held young survivor 01:38

This brings us back to the Air Force's failure to notify civilian law enforcement of Kelley's criminal record.

This article states that anyone who "who attempts or offers with unlawful force or violence to do bodily harm to another person" is guilty of assault, and any person who "commits and assault" resulting or likely to result in death or serious injury is guilty of aggravated assault.

A US Air Force spokeswoman told CNN Kelley was punished under these provisions and received a " bad conduct discharge ." This discharge is different than a "dishonorable discharge," which would have immediately prevented him from being sold a weapon under the Gun Control Act.

However, somehow the seriousness of the convictions never got relayed.

The Air Force acknowledged Monday evening that it did not appropriately relay Kelley's court martial conviction for domestic assault to civilian law enforcement, preventing it from appearing in the federal database that licensed gun dealers are required to check before selling someone a firearm.

"Had his information been in the database, it should have prevented gun sales to Kelley," the Air Force said.

In the statement, the Air Force says the Air Force Inspector General is currently conducting an investigation into what happened.

"Somebody really dropped the ball," Former Air Force Chief prosecutor Colonel Don Christensen told CNN.

JUST WATCHED On GPS: The many meanings of the 2nd Amendment Replay More Videos ... MUST WATCH On GPS: The many meanings of the 2nd Amendment 03:45

When trying to get a gun, applicants have to fill out ATF form 4473 , a Firearms Transaction Record. Prospective buyers are asked, "Have you ever been discharged from the Armed Forces under dishonorable conditions?" Technically, for Kelley, they answer was no, since the military makes critical distinctions between other-than-honorable, bad conduct and dishonorable discharges.

The form also asks, "Have you ever been convicted in any court of a misdemeanor crime of domestic violence?"