Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4200 -- Made get_admin_log template tag behave according to its

docstring (user specifier is optional). Thanks, Bryan Chow.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d1b0d34dc67941ce7c285c29d3f4031954c20283 1 parent af846c0
Malcolm Tredinnick malcolmt authored
Showing with 7 additions and 3 deletions.
  1. +1 −0  AUTHORS
  2. +6 −3 django/contrib/admin/templatetags/log.py
1  AUTHORS
View
@@ -70,6 +70,7 @@ answer newbie questions, and generally made Django that much better:
Amit Chakradeo <http://amit.chakradeo.net/>
ChaosKCW
ivan.chelubeev@gmail.com
+ Bryan Chow <bryan at verdjn dot com>
Ian Clelland <clelland@gmail.com>
crankycoder@gmail.com
Matt Croydon <http://www.postneo.com/>
9 django/contrib/admin/templatetags/log.py
View
@@ -11,9 +11,12 @@ def __repr__(self):
return "<GetAdminLog Node>"
def render(self, context):
- if self.user is not None and not self.user.isdigit():
- self.user = context[self.user].id
- context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit]
+ if self.user is None:
+ context[self.varname] = LogEntry.objects.all().select_related()[: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()[:self.limit]
return ''
class DoGetAdminLog:
Please sign in to comment.
Something went wrong with that request. Please try again.