Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit df4cb60004db5cbbe402233138f2f0c804a46f15 1 parent 3550456
Russell Keith-Magee authored December 22, 2010
4  django/contrib/admin/models.py
@@ -51,4 +51,6 @@ def get_admin_url(self):
51 51
         Returns the admin URL to edit the object represented by this log entry.
52 52
         This is relative to the Django admin index page.
53 53
         """
54  
-        return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id)))
  54
+        if self.content_type and self.object_id:
  55
+            return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id)))
  56
+        return None
2  django/contrib/admin/templates/admin/index.html
@@ -60,7 +60,7 @@
60 60
             <ul class="actionlist">
61 61
             {% for entry in admin_log %}
62 62
             <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
63  
-                {% if entry.is_deletion %}
  63
+                {% if entry.is_deletion or not entry.get_admin_url %}
64 64
                     {{ entry.object_repr }}
65 65
                 {% else %}
66 66
                     <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>

0 notes on commit df4cb60

Please sign in to comment.
Something went wrong with that request. Please try again.