Transaction management
WhyNotHugo opened this issue · 2 comments
WhyNotHugo commented
Validating recepts handles DB transactions by itself just fine.
Using this can be dangerous:
with transaction.atomic()
receipt.validate()
If there's a failure during this call, the can be irrecoverable data loss. validate()
should internally check that no transaction is ongoing, and raise ProgramingError()
if it is being run inside a transaction.
WhyNotHugo commented
Error message should suggest reading the validate()
docstring.
juanpsenn commented
May be a check if validate is not running in an atomic context should be fine?