Use the new django transaction API

fixes #1027
Ok, then can you please add the issue number here (and maybe first open an respective issue)?