﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19777	Casting a SimpleLazyObject to an int fails	Matt Robenolt	nobody	"Should be pretty self explanatory. We noticed the bug when passing `request.user` into a filter like:

{{{
Model.objects.filter(user=request.user)
}}}

Since Django is attempting to coerce the object to an int, it fails on the SimpleLazyObject yielding:

{{{
TypeError: int() argument must be a string or a number, not 'SimpleLazyObject'
}}}

The error can be reproduced simple by doing:

{{{
class Foo(object):
  __int__ = lambda self: 1

int(SimpleLazyObject(Foo)))
}}}

See https://github.com/django/django/pull/706 for a patch."	Bug	closed	Core (Other)	dev	Normal	wontfix	functional simplelazyobject		Unreviewed	1	0	0	0	0	0
