Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'AnonymousUser' object has no attribute '_meta' #77

Open
hmswaffles opened this issue Aug 23, 2019 · 0 comments
Open

'AnonymousUser' object has no attribute '_meta' #77

hmswaffles opened this issue Aug 23, 2019 · 0 comments

Comments

@hmswaffles
Copy link

Hello!

I've just found the Pinax ecosystem, it looks great. Thank you all for your work.

I've created the 'account' starter project, and when I sign-up for a new account after I click the submit button, I get the following error: 'AnonymousUser' object has no attribute '_meta'. Please help me understand what I am missing, as the traceback seems to be entirely within the Django Code.

Thanks,
Evan

..
TRACEBACK:
Environment:
Django Version: 2.2.4
Python Version: 3.7.3

Request Method: POST
Request URL: http://localhost:8000/account/signup/

Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'bootstrapform',
'pinax.templates',
'account',
'pinax.eventlog',
'pinax.webanalytics',
'newapp']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "newapp/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "newapp/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)

File "newapp/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "newapp/lib/python3.7/site-packages/django/views/generic/base.py" in view
71. return self.dispatch(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
76. return view(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
142. response = view_func(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/account/views.py" in dispatch
151. return super(SignupView, self).dispatch(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch
97. return handler(request, *args, **kwargs)

File "newapp/lib/python3.7/site-packages/account/views.py" in post
177. return super(SignupView, self).post(*args, **kwargs)

File "newapp/lib/python3.7/site-packages/django/views/generic/edit.py" in post
142. return self.form_valid(form)

File "newapp/lib/python3.7/site-packages/account/views.py" in form_valid
243. self.login_user()

File "newapp/lib/python3.7/site-packages/account/views.py" in login_user
293. auth.login(self.request, user)

File "newapp/lib/python3.7/site-packages/django/contrib/auth/init.py" in login
126. request.session[SESSION_KEY] = user._meta.pk.value_to_string(user)

File "newapp/lib/python3.7/site-packages/django/utils/functional.py" in inner
257. return func(self._wrapped, *args)

Exception Type: AttributeError at /account/signup/
Exception Value: 'AnonymousUser' object has no attribute '_meta'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant