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

'username' lookup (if set using DJANGO_REST_LOOKUP_FIELD = 'username') cannot validate the email validation #192

Open
abdullah131566 opened this issue Sep 13, 2024 · 0 comments

Comments

@abdullah131566
Copy link

If I set the lookup field to be username instead of email, the POST request gives error "Enter a valid email address."

Steps to reproduce:

  1. Add this to settings.py

DJANGO_REST_LOOKUP_FIELD = 'username'

  1. Send a POST request with following body content:

{ "email": "someusername123" }

Expected behavior
The keyname must be dynamic and not always be the 'email' in the POST request body. The respective field validations should run based on the declared field as described above.

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