I have a function friend_exists
like this:
def friend_exists(request, pid):
result = False
try:
user = Friend.objects.get(pid=pid)
except Friend.DoesNotExist:
pass
if user:
result = True
return result
I'm calling it from my other function like this:
exists = friend_exists(form.cleaned_data['pid'])
where pid = u'12345678'
. Why I'm getting:
Exception Type: TypeError at /user/register/
Exception Value: friend_exists() takes exactly 2 arguments (1 given)
Any ideas?