Reputation: 47104
Hi I'm trying to use the user_passes_test decorator mentioned here. But I keep getting this error:
'bool' object is not callable
My usage:
@user_passes_test(lambda u: u.is_active() and u.is_staff())
def fulfillment(request):
...
Upvotes: 1
Views: 2392
Reputation: 1506
another situation if you write a code like this :
newFile = open('pickled','w')
pickle.dump(newText, newFile)
newFile.closed()
as you see, newFile.closed()
will trigger the same error, 'bool' object is not callable
it's caused : newFile.closed()
is a boolean value... and it's assigned to a variable or in equation or something else...
Upvotes: 1