Improve transaction handling in generic inline formset views
This PR is motivated by the error we encountered in !271 (merged) with these views, and my own work with transactions. This PR both simplifies and improves the use of transactions in the generic inline formset views. I've tested that this works with the expanded event views in !271 (merged).
-
form_valid
andformset_valid
are now called byform_and_formset_valid
, This simplifies the code, especially by not requiring us to manually calltransaction.rollback
when the form is valid but the formset isn't. -
form_invalid
andformset_invalid
have been combined into a singleform_or_formset_invalid
. There was no real reason to have separate functions for this, and now we no longer need to keep track of whether it is the form or the formset that isn't valid.
Edited by Sivert Olstad