[Dev-flock] contrib.auth attribute errors
Lucy Mendel
lucy at thoughtandmemory.org
Wed Apr 30 22:57:37 EDT 2008
ratings, and possibly other things, don't work because of user
authentication. anyone know what the dilly is on this one?
in the meantime, i'm moving ahead on svn-izing /var/sites/hm_demo (not
hm_production, which i think is a dud), or doing whatever is necessary
to publish hm_staging to hm_demo.
here's the problem:
Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.contrib import auth;
>>> dir(auth);
['BACKEND_SESSION_KEY', 'ImproperlyConfigured',
'REDIRECT_FIELD_NAME', 'SESSION_KEY',
'__builtins__', '__doc__', '__file__', '__name__', '__path__',
'authenticate', 'datetime', 'get_backends',
'get_user', 'load_backend', 'login', 'logout']
>>> auth.models
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'models'
here are the details:
user clicks on a star in order to rate a review. the user can be
logged in or be anonymous; same error:
POST fails (yay firebug, boo viewing html in plain text)
Request URL: http://thoughtandmemory.org/Main/add_behavior_rating/
AttributeError': module' object has no attribute 'models'
/var/sites/hm_demo/db/utils.py in current_user, line 87
def current_user():
"""
@summary:
@return:
@rtype:
@raise UserNotAuthenticated:
"""
user = threadlocals.get_current_user()
if isinstance(user, auth.models.User): <<<<<<<< line 87
return user
else:
return auth.models.User.objects.all()[0]
#raise UserNotAuthenticated()
More information about the Dev-flock
mailing list