Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from clemente/master
Browse files Browse the repository at this point in the history
new option to choose whether User.is_active==True means verified or not
  • Loading branch information
Scott Bradley committed Dec 3, 2014
2 parents c220d0f + 2beded6 commit 0cfb768
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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

0 comments on commit 0cfb768

Please sign in to comment.