1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Decorators
==========
Verified E-mail Required
------------------------
Even when email verification is not mandatory during signup, there
may be circumstances during which you really want to prevent
unverified users from proceeding. For this purpose you can use the
following decorator::
from allauth.account.decorators import verified_email_required
@verified_email_required
def verified_users_only_view(request):
...
The behavior is as follows:
- If the user isn't logged in, it acts identically to the
``login_required`` decorator.
- If the user is logged in but has no verified e-mail address, an
e-mail verification mail is automatically resent and the user is
presented with a page informing them they need to verify their email
address.
|