From a256ac339086ea25445737de38018f9dd2862583 Mon Sep 17 00:00:00 2001 From: julianklotz Date: Thu, 28 Sep 2023 10:24:22 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20=E2=80=9Chas=20no=20attribute?= =?UTF-8?q?=E2=80=9D=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reversion/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reversion/admin.py b/reversion/admin.py index 2c84f0a4..2b94a0fe 100644 --- a/reversion/admin.py +++ b/reversion/admin.py @@ -184,7 +184,7 @@ def _reversion_revisionform_view(self, request, version, template_name, extra_co raise _RollBackRevisionView(response) # Raise exception to undo the transaction and revision. else: raise RevertError(_("Could not load %(object_repr)s version - not found") % { - "object_repr": self.object_repr, + "object_repr": version.object_repr, }) except (RevertError, models.ProtectedError) as ex: opts = self.model._meta From b88c05a6c968550c0afe7d3d8e757f9acdbdb35e Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Fri, 29 Sep 2023 18:17:28 +0100 Subject: [PATCH 2/2] v5.0.6 --- CHANGELOG.rst | 6 ++++++ reversion/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4e8e672d..2305cf65 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,12 @@ django-reversion changelog ========================== +5.0.6 - 2023-09-29 +------------------ + +- Fix handling case of missing object in admin revert (@julianklotz) + + 5.0.5 - 2023-09-19 ------------------ diff --git a/reversion/__init__.py b/reversion/__init__.py index 989bc05e..941dcc7a 100644 --- a/reversion/__init__.py +++ b/reversion/__init__.py @@ -36,4 +36,4 @@ get_registered_models, ) -__version__ = VERSION = (5, 0, 5) +__version__ = VERSION = (5, 0, 6)