django: request.user is an int, not a User object -
I am using django 1.0 and I have views.py in a way that starts like this: / P>
def my_view (request, org_id): a = request.user.is_staff () # Error in this line is # more code ...
when I try to load the page, I got the error "The int object is not able to call" on the line described above "My users" is a "user" object in the files that are imported at the top of view.py Is, lake And deleting this import statement from view.py does not make this error. Is it possible that this other user class is probably struggling in one of my files, perhaps? Do you have any other suggestions that what might be the reason for this error?
I think the problem is is_staff ()
. Try
a = request.user.is_staff
is_staff
is an area of the model. But it is boolean, however it may be that it is stored internally as int
.
Comments
Post a Comment