[Django] #27405: AdminLogNode render TypeError exception while calling get_admin_log with no user (1.8.x)

5 views
Skip to first unread message

Django

unread,
Oct 30, 2016, 11:21:00 AM10/30/16
to django-...@googlegroups.com
#27405: AdminLogNode render TypeError exception while calling get_admin_log with no
user (1.8.x)
-------------------------------------+-------------------------------------
Reporter: Ihor | Owner: nobody
Polyakov |
Type: Bug | Status: new
Component: | Version: 1.8
contrib.admin | Keywords: exception,
Severity: Normal | TypeError, log, TypeError
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
If I call in template:
`{% get_admin_log 10 as admin_log %}` (without `for_user user`):
it will throw an exception: `TypeError: slice indices must be integers`
from this line (django/contrib/admin/templatetags/log.py):
`context[self.varname] =
LogEntry.objects.all().select_related('content_type',
'user')[:self.limit]`
because self.limit was not wrapped with `int` function like it is in other
if statement branch:
...`).select_related('content_type', 'user')[:int(self.limit)]`

My simple fix is here:
https://github.com/django/django/pull/7453

--
Ticket URL: <https://code.djangoproject.com/ticket/27405>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 30, 2016, 11:22:57 AM10/30/16
to django-...@googlegroups.com
#27405: AdminLogNode render TypeError exception while calling get_admin_log with no
user (1.8.x)
-------------------------------------+-------------------------------------
Reporter: Ihor Polyakov | Owner: Ihor
| Polyakov
Type: Bug | Status: assigned
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: exception, | Triage Stage:
TypeError, log, TypeError | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ihor Polyakov):

* owner: nobody => Ihor Polyakov
* status: new => assigned


Comment:

PR on Github: https://github.com/django/django/pull/7453

--
Ticket URL: <https://code.djangoproject.com/ticket/27405#comment:1>

Django

unread,
Oct 30, 2016, 11:52:22 AM10/30/16
to django-...@googlegroups.com
#27405: AdminLogNode render TypeError exception while calling get_admin_log with no
user (1.8.x)
-------------------------------------+-------------------------------------
Reporter: Ihor Polyakov | Owner: Ihor
| Polyakov
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution: wontfix

Keywords: exception, | Triage Stage:
TypeError, log, TypeError | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: assigned => closed
* resolution: => wontfix


Comment:

Per our [https://docs.djangoproject.com/en/dev/internals/release-process
/#supported-versions supported versions policy], 1.8 is only receiving
security fixes.

--
Ticket URL: <https://code.djangoproject.com/ticket/27405#comment:2>

Reply all
Reply to author
Forward
0 new messages