Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored May 08, 2007
1  AUTHORS
@@ -70,6 +70,7 @@ answer newbie questions, and generally made Django that much better:
70 70
     Amit Chakradeo <http://amit.chakradeo.net/>
71 71
     ChaosKCW
72 72
     ivan.chelubeev@gmail.com
  73
+    Bryan Chow <bryan at verdjn dot com>
73 74
     Ian Clelland <clelland@gmail.com>
74 75
     crankycoder@gmail.com
75 76
     Matt Croydon <http://www.postneo.com/>
9  django/contrib/admin/templatetags/log.py
@@ -11,9 +11,12 @@ def __repr__(self):
11 11
         return "<GetAdminLog Node>"
12 12
 
13 13
     def render(self, context):
14  
-        if self.user is not None and not self.user.isdigit():
15  
-            self.user = context[self.user].id
16  
-        context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit]
  14
+        if self.user is None:
  15
+            context[self.varname] = LogEntry.objects.all().select_related()[:self.limit]
  16
+        else:
  17
+            if not self.user.isdigit():
  18
+                self.user = context[self.user].id
  19
+            context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit]
17 20
         return ''
18 21
 
19 22
 class DoGetAdminLog:

0 notes on commit d1b0d34

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