Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ MULTIMAIL_ALLOW_VERIFICATION_OF_INACTIVE_ACCOUNTS
Default: False. Whether to allow users to verify emails associated
with a deactivated account.

MULTIMAIL_AUTOVERIFY_ACTIVE_ACCOUNTS
Default: True. Whether to verify accounts that have been set as active
outside of django-multimail.

MULTIMAIL_DELETE_PRIMARY
Default: False. Whether to clear the email field on the user object
when the last EmailAddress is deleted.
Expand Down
3 changes: 2 additions & 1 deletion multimail/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def email_address_handler(sender, **kwargs):
# Provides that an address that has been just verified
# without use of django-multimail, is still considered
# verified in conditions of django-multimail
if user.is_active and not addr.verified_at:
if MM.AUTOVERIFY_ACTIVE_ACCOUNTS and \
user.is_active and not addr.verified_at:
addr.verified_at = now()
except EmailAddress.DoesNotExist:
addr = EmailAddress()
Expand Down
1 change: 1 addition & 0 deletions multimail/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def __getattr__(self, index):

MM = Settings(
ALLOW_VERIFICATION_OF_INACTIVE_ACCOUNTS = False,
AUTOVERIFY_ACTIVE_ACCOUNTS = True,
DELETE_PRIMARY = False,
VERIFICATION_LINK_SENT_MESSAGE = \
_("A verification link has been sent to %(email)s"),
Expand Down