Premature .revert() and unique constraint violation

12 views
Skip to first unread message

Danny Adair

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

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 https://github.com/etianen/django-reversion/issues/593

Cheers,
Danny
Reply all
Reply to author
Forward
0 new messages