-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
Description
Describe the bug
I changed the default flag field with USER_VERIFICATION_FLAG_FIELD
and created a superuser with the Django command createsuperuser
. Changing this superuser's email results in an error when verifying the email.
Expected behavior
Superuser email is changed.
Actual behavior
Error 400 with the error message: "User not found."
Steps to reproduce
- Create a Boolean field in user model and set
USER_VERIFICATION_FLAG_FIELD
to this field; - Create a superuser with Django admin command
createsuperuser
; - Register a new mail for this superuser;
- Validate the new email.
Possible explanation
This is due to the fact createsuperuser
will not enable the custom flag field (as it sets username
, email
and password
by default), hence this superuser is not considered as valid and cannot be retrieved.
In rest_registration.api.views.register_email.process_verify_email_data
, get_user_by_verification_id
is called with argument require_verified
True by default.
Associated PR
See #145.