From 64fd5b2acb5c14623f31a5675b46652024186577 Mon Sep 17 00:00:00 2001 From: eduardo Date: Wed, 17 Jul 2019 07:56:37 +0200 Subject: [PATCH] Fix django-suit NoneType is not iterable https://github.com/darklow/django-suit/issues/633 https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.AdminSite.each_context --- reversion_compare/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reversion_compare/admin.py b/reversion_compare/admin.py index bed097b..4f65778 100644 --- a/reversion_compare/admin.py +++ b/reversion_compare/admin.py @@ -165,6 +165,7 @@ def compare_view(self, request, object_id, extra_context=None): opts = self.model._meta context = { + **self.admin_site.each_context(request), "opts": opts, "app_label": opts.app_label, "model_name": capfirst(opts.verbose_name), @@ -193,8 +194,7 @@ def compare_view(self, request, object_id, extra_context=None): prev_url = "?version_id1=%i&version_id2=%i" % (prev_version.id, version1.id) context.update({"prev_url": prev_url}) - extra_context = extra_context or {} - context.update(extra_context) + context.update(extra_context or {}) return render(request, self.compare_template or self._get_template_list("compare.html"), context)