transaction atomic fix for Django >= 1.6