From df4cb60004db5cbbe402233138f2f0c804a46f15 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Dec 2010 16:24:30 +0000 Subject: [PATCH] Fixed #14935 -- Corrected a test failure introduced by r14992, which revealed an unhandled edge case in LogEntry handling in the admin. Thanks to Ramiro Morales for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15024 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/models.py | 4 +++- django/contrib/admin/templates/admin/index.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py index 259884faba..73810b7399 100644 --- a/django/contrib/admin/models.py +++ b/django/contrib/admin/models.py @@ -51,4 +51,6 @@ class LogEntry(models.Model): Returns the admin URL to edit the object represented by this log entry. This is relative to the Django admin index page. """ - return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id))) + if self.content_type and self.object_id: + return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id))) + return None \ No newline at end of file diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html index 772474bea5..d392f075ad 100644 --- a/django/contrib/admin/templates/admin/index.html +++ b/django/contrib/admin/templates/admin/index.html @@ -60,7 +60,7 @@