Premature .revert() and unique constraint violation

Skip to first unread message

Danny Adair

Oct 17, 2016, 3:27:18 AM10/17/16
to django-reversion discussion group

We're migrating from django-reversion 1.5.2 to 1.10.2.

When there's a unique constraint on a Model for a combination of
fields, and then an instance is deleted and a new one is created which
"takes its place" in regards to that combination, then it's not
possible to restore the deleted version because it would violate the
unique constraint. So far so good.

That used to be simply an error message when you click "Save" on the
recover form, but now the invocation of the recover form itself
already does a .revert() on the version, which will throw an ugly
"internal" RevertError rather than a ValidationError with message on
the form as before.
How could I get around this?

See also issue

Reply all
Reply to author
0 new messages