mirror of
https://github.com/django/django.git
synced 2025-07-19 17:19:12 +00:00
[1.0.X] Fixed #8110 -- Allow for AdminLogNode's render to be called more than once.
Backport of [9233] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9234 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4537f33487
commit
36e90e5736
@ -14,9 +14,10 @@ class AdminLogNode(template.Node):
|
|||||||
if self.user is None:
|
if self.user is None:
|
||||||
context[self.varname] = LogEntry.objects.all().select_related('content_type', 'user')[:self.limit]
|
context[self.varname] = LogEntry.objects.all().select_related('content_type', 'user')[:self.limit]
|
||||||
else:
|
else:
|
||||||
if not self.user.isdigit():
|
user_id = self.user
|
||||||
self.user = context[self.user].id
|
if not user_id.isdigit():
|
||||||
context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related('content_type', 'user')[:self.limit]
|
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 ''
|
return ''
|
||||||
|
|
||||||
class DoGetAdminLog:
|
class DoGetAdminLog:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user