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

views.Reset.invalid AttributeError exception #48

Open
umgelurgel opened this issue Aug 31, 2016 · 2 comments
Open

views.Reset.invalid AttributeError exception #48

umgelurgel opened this issue Aug 31, 2016 · 2 comments

Comments

@umgelurgel
Copy link

Looks like the exception in https://github.com/brutasse/django-password-reset/blob/master/password_reset/views.py#L139 is thrown before Reset.user is assigned and results in a call to Reset.get_form_kwargs that tries to access Reset.user.

Exception details:

AttributeError: 'Reset' object has no attribute 'user'
  File "django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "password_reset/views.py", line 132, in dispatch
    return self.invalid()
  File "password_reset/views.py", line 138, in invalid
    return self.render_to_response(self.get_context_data(invalid=True))
  File "password_reset/views.py", line 146, in get_context_data
    ctx = super(Reset, self).get_context_data(**kwargs)
  File "django/views/generic/edit.py", line 122, in get_context_data
    kwargs['form'] = self.get_form()
  File "django/views/generic/edit.py", line 74, in get_form
    return form_class(**self.get_form_kwargs())
  File "password_reset/views.py", line 142, in get_form_kwargs
    kwargs['user'] = self.user
@twoblokeswithapostie
Copy link

Hi @umgelurgel, did you find a solution for this issue? It keeps getting logged in my sentry and I can't replicate it.

Cheers,

M

@umgelurgel
Copy link
Author

Sorry @twoblokeswithapostie , stopped working on the project where this was the problem a while back and don't remember how was this resolved.

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

2 participants