diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-08 03:56:44 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-08 03:56:44 +0000 |
| commit | d1b0d34dc67941ce7c285c29d3f4031954c20283 (patch) | |
| tree | 14f5120ce10d59485fe1c80bc1844a67efcea7a2 | |
| parent | af846c0b8b53aac731a39d11bfe5dac48d9da9c0 (diff) | |
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
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | django/contrib/admin/templatetags/log.py | 9 |
2 files changed, 7 insertions, 3 deletions
@@ -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/> diff --git a/django/contrib/admin/templatetags/log.py b/django/contrib/admin/templatetags/log.py index 5caba2b795..8d52d2e944 100644 --- a/django/contrib/admin/templatetags/log.py +++ b/django/contrib/admin/templatetags/log.py @@ -11,9 +11,12 @@ class AdminLogNode(template.Node): 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: |
