Make `REGISTRATION_VERIFY_EMAIL` a valid option
This MR proposes
To make REGISTRATION_VERIFY_EMAIL
a valid option that is available in templates.
Current situation
Quite often, the question arises of how to disable email verification for new users. The current solution is to uncomment REGISTRATION_VERIFY_EMAIL
in local.py
and probably have a template override. The latter can cause problems in the future when the register.html
template is changed by any chance.
Proposed solution
By making REGISTRATION_VERIFY_EMAIL
a valid option through the context processor, we can now react in our register.html
template accordingly and either display the email field or hide it and pre-fill it with a fake email in form of {{request.session.registration_uid}}@{{request.get_host}}
depending on it's setting. The default will still be True
.
This will solve the confusion about how to disable email verification. All that has to be done now is uncomment the REGISTRATION_VERIFY_EMAIL = False
setting in local.py
, the rest is handled by AA through the new template.