Code

Ticket #8110: 8110.diff

File 8110.diff, 778 bytes (added by kmtracey, 6 years ago)

Allow for render being called more than once for an AdminLogNode

Line 
1Index: django/contrib/admin/templatetags/log.py
2===================================================================
3--- django/contrib/admin/templatetags/log.py    (revision 8979)
4+++ django/contrib/admin/templatetags/log.py    (working copy)
5@@ -15,8 +15,8 @@
6             context[self.varname] = LogEntry.objects.all().select_related()[:self.limit]
7         else:
8             if not self.user.isdigit():
9-                self.user = context[self.user].id
10-            context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit]
11+                user_id = context[self.user].id
12+            context[self.varname] = LogEntry.objects.filter(user__id__exact=user_id).select_related()[:self.limit]
13         return ''
14 
15 class DoGetAdminLog: