django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

Fix errors when authenticated user has no associated email address

Open rubengrill opened this issue 8 years ago • 3 comments

There are two cases where this can happen currently:

  • User was added without using the register API (e.g. in django admin)
  • Custom AuthenticationBackend is used returning a user different than AUTH_USER_MODEL

In both cases the current result would be a 500 response.

The fix returns a 400 with E-mail is not verified..

rubengrill avatar Oct 14 '16 09:10 rubengrill

Coverage Status

Coverage increased (+0.07%) to 97.143% when pulling 1fc84ce03ed571161f779499b65a74d50beae377 on rubengrill:login-serializer into 3b80fcbca9b3d9f9f918cda27db86ee0869556cd on Tivix:master.

coveralls avatar Oct 14 '16 09:10 coveralls

@rubengrill Can you please resolve the conflicts? I'll merge this PR right afterwards. Thank you for providing unit tests as well! 👏

mariodev avatar Mar 19 '17 12:03 mariodev

Hi, as a user of rest-auth, thanks for the contribution! This repo is not maintained anymore, so the development moved to dj-rest-auth. (reference: https://github.com/Tivix/django-rest-auth/issues/568) It may be best, if you move this PR there. (and upgrade to using dj_rest_auth)

new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)

Many Thanks, Barney

BarnabasSzabolcs avatar May 30 '20 01:05 BarnabasSzabolcs