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

NameError: name 'get_adapter is not defined #286

Closed
bjsvedin opened this issue Jul 20, 2021 · 2 comments
Closed

NameError: name 'get_adapter is not defined #286

bjsvedin opened this issue Jul 20, 2021 · 2 comments

Comments

@bjsvedin
Copy link

bjsvedin commented Jul 20, 2021

Steps to reproduce

  • Include dj-rest-auth in project as an installed apps and it's urls.
  • DO NOT install allauth as you don't need to use it, and it's big.
  • make a post request to the url "password/reset/"
  • Profit

This error occurs in forms.py, and only when 'allauth' is not installed. It looks like it was introduced on commit 82bd8b1, and released with 2.1.8

File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dj_rest_auth/views.py", line 248, in post
serializer.is_valid(raise_exception=True)
File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 220, in is_valid
self._validated_data = self.run_validation(self.initial_data)
File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 419, in run_validation
value = self.to_internal_value(data)
File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 478, in to_internal_value
validated_value = validate_method(validated_value)
File "/usr/local/lib/python3.9/site-packages/dj_rest_auth/serializers.py", line 243, in validate_email
if not self.reset_form.is_valid():
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 175, in is_valid
return self.is_bound and not self.errors
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 170, in errors
self.full_clean()
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 372, in full_clean
self._clean_fields()
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 393, in clean_fields
value = getattr(self, 'clean
%s' % name)()
File "/usr/local/lib/python3.9/site-packages/dj_rest_auth/forms.py", line 27, in clean_email
email = get_adapter().clean_email(email)
NameError: name 'get_adapter' is not defined

@surister
Copy link

surister commented Aug 2, 2021

It was fixed here 3d21042
but still not published in pypy, until it gets published versions 2.1.18 and 2.1.19 have a broken non allauth password reset.

@Luctia
Copy link

Luctia commented Aug 4, 2021

I would update to 2.1.10, but then I get #295...

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

3 participants