From 9feebb10f91cb7faf00b6a83ea5a7d03f739e421 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Fri, 17 Oct 2008 22:43:36 +0000 Subject: [PATCH] Fixed #8110 -- Allow for AdminLogNode's render to be called more than once. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9233 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/log.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/django/contrib/admin/templatetags/log.py b/django/contrib/admin/templatetags/log.py index 84c7e6c7a6..36f40f1942 100644 --- a/django/contrib/admin/templatetags/log.py +++ b/django/contrib/admin/templatetags/log.py @@ -14,9 +14,10 @@ class AdminLogNode(template.Node): if self.user is None: context[self.varname] = LogEntry.objects.all().select_related('content_type', 'user')[:self.limit] else: - if not self.user.isdigit(): - self.user = context[self.user].id - context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related('content_type', 'user')[:self.limit] + user_id = self.user + if not user_id.isdigit(): + user_id = context[self.user].id + context[self.varname] = LogEntry.objects.filter(user__id__exact=user_id).select_related('content_type', 'user')[:self.limit] return '' class DoGetAdminLog: