UEWBot / dipvis

Django-based visualiser for tournaments for the boardgame Diplomacy
GNU General Public License v3.0
7 stars 5 forks source link

sc_counts view should not alter the database when there's an error in the form #190

Closed UEWBot closed 3 years ago

UEWBot commented 3 years ago

sc_counts() in game_views.py updates CentreCount objects and can then raise an error while processing the death_form. I'm thinking that we may be able to avoid this using transactions - start a transaction before making any changes, and (re-)raise any ValidationError exceptions so that the transaction gets rolled back.