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

Fix response messages

Open dgilge opened this issue 6 years ago • 2 comments

Fixes an issue where the response messages are displayed as a list with one character per item:

AssertionError: {'detail': ['V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', [80 chars]'.']} != {'detail': 'Verification e-mail sent.'}

I've tried to write a test to reproduce it but for some reason it works with ugettext_lazy and Travis-CI. [Update:] I found out that this behaviour is related to djangorestframework-camel-case in my case (see also https://github.com/vbabiy/djangorestframework-camel-case/issues/40). But I still think that using ugettext is the correct way to solve it.

However, ugettext_lazy shouldn't be used here and I replaced it with ugettext. (This made the tests in my project pass.) See the Django docs. I checked that the calls to these functions are not "located in code paths that are executed at module load time".

dgilge avatar Jun 11 '18 08:06 dgilge

Coverage Status

Coverage remained the same at 96.359% when pulling e5463c8257a12a4ff792c49f2115f901deffc1e1 on dgilge:ugettext into 95fafe5e0f6716296a1c664c2b870876a6b4e0cc on Tivix:master.

coveralls avatar Jun 11 '18 08:06 coveralls

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