The following editorial appears on Bloomberg View:

America’s extraordinary gun violence is enabled by a lack of both laws and responsibility. In a small but significant way, bipartisan legislation proposed by Sens. Jeff Flake and Martin Heinrich seeks to address both failings.

A record of domestic violence is a frequent denominator in cases of gun violence. About 50 U.S. women are shot dead each month by an intimate partner. More than 4 million women say they have been threatened with a gun by an intimate partner.

The man who killed 26 and injured 20 last weekend at a church in Sutherland Springs, Texas, had been court-martialed in 2012, while he was in the U.S. Air Force, on charges of assault on his wife and stepson. A spokesman for the Texas Department of Public Safety said a “domestic situation” was also at the root of the church massacre.

This conviction should have prevented the killer from purchasing several guns he acquired, including a semi-automatic rifle used in the church massacre, from licensed dealers. Yet the Air Force acknowledged this week that it had failed to enter the man’s name into a federal database used for instant background checks of firearm purchasers.

The problem goes beyond a single instance of incompetence. The military has often failed to report criminal records as required. Many states, whose participation in the background-check system is voluntary, also fail to report key records of drug abuse, mental health or felony convictions that would prohibit a firearm purchase.

Background checks are still the best way to keep guns away from dangerous people, which is why safety advocates must continue to push to close the private gun sale loophole and to improve sloppy reporting to the background-check databases by all levels of government.

The bill from Flake, an Arizona Republican, and Heinrich, a New Mexico Democrat, is a step in the right direction. It would require the military both to identify cases of domestic violence and to promptly submit conviction information to the criminal background database. To make sure the system is working, and supervised, the bill would also require annual reports to Congress.

The Pentagon’s failure may be a remnant of an era when domestic violence wasn’t taken seriously. Or it may simply be more evidence that nonchalance about guns makes gun violence more likely. Times, and attitudes, have changed about domestic violence. This Senate bill will help move the law, and the nation, to a more responsible position on gun violence as well.