I found a few tidbits on the interwebs...First is putting a thin layer of sand over the top of your potting soil which inhibits the gnats from reaching the soil, but still allows water to hit your soil. The second is taking about a cup of water and adding a few drops of dish soap...make sure you use something like palmolive which is biodegradable...then agitate slightly to sud and pour on your soil which should kill the gnats...

Mind that these are remedies I found on the internet and havn't actually tried them myself but the sand at least seems safe and fairly inexpensive