summaryrefslogtreecommitdiff
path: root/django/contrib/admin/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/admin/models.py')
-rw-r--r--django/contrib/admin/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py
index 4443f13dac..82b3cc0585 100644
--- a/django/contrib/admin/models.py
+++ b/django/contrib/admin/models.py
@@ -1,5 +1,4 @@
import json
-from contextlib import suppress
from django.conf import settings
from django.contrib.admin.utils import quote
@@ -138,6 +137,8 @@ class LogEntry(models.Model):
"""
if self.content_type and self.object_id:
url_name = 'admin:%s_%s_change' % (self.content_type.app_label, self.content_type.model)
- with suppress(NoReverseMatch):
+ try:
return reverse(url_name, args=(quote(self.object_id),))
+ except NoReverseMatch:
+ pass
return None