views:

124

answers:

2

I'm getting an AttributeError using rcrowley's django-twitterauth: http://github.com/rcrowley/django-twitterauth

Looks like it occurs when the validate() method is called on the user object, which the user object does not have. I don't know why the author did this. I'm really new to Django, wondering if anyone else knows. I know you can validate the model/data using the form object, but it looks like there's no form here:

@needs_user('auth_login')
def info(req):
 if 'POST' == req.method:
  req.user.email = req.POST['email']
  errors = req.user.validate()
  if not errors: req.user.save()
  return render_to_response('info.html', {
   'user': req.user,
   'errors': errors
  })
 return render_to_response('info.html', {'user': req.user})
+1  A: 

The default django contrib.auth.models.User may not have a validate() command, but the twitterauth.models.User does have one ... did you make any changes to ensure your project is using the twitterauth's model and not the default one ?

thornomad
A: 

How do I do that? replace every instance of:

from django.contrib.auth.models import User

with:

from appname.auth.models import User

?

Jay