Skip to content

Commit

Permalink
remove email add notification, change notification setting name
Browse files Browse the repository at this point in the history
  • Loading branch information
varun kumar committed Dec 4, 2023
1 parent e0275cf commit 000c971
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 32 deletions.
4 changes: 2 additions & 2 deletions allauth/account/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ def REAUTHENTICATION_TIMEOUT(self):
return self._setting("REAUTHENTICATION_TIMEOUT", 300)

@property
def ACCOUNT_EMAIL_NOTIFICATIONS(self):
return self._setting("ACCOUNT_EMAIL_NOTIFICATIONS", False)
def EMAIL_NOTIFICATIONS(self):
return self._setting("EMAIL_NOTIFICATIONS", False)

@property
def REAUTHENTICATION_REQUIRED(self):
Expand Down
16 changes: 0 additions & 16 deletions allauth/account/tests/test_confirm_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,22 +364,6 @@ def test_confirm_email_with_same_user_logged_in(self):
self.assertEqual(user, resp.wsgi_request.user)


@patch("allauth.account.app_settings.ACCOUNT_EMAIL_NOTIFICATIONS", True)
def test_notification_on_email_add(auth_client, user, client):
settings.ACCOUNT_MAX_EMAIL_ADDRESSES = 2
client.force_login(user)
response = client.post(
reverse("account_email"),
{"email": "[email protected]", "action_add": ""},
**{
"HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
)
assert response.status_code == 302
assert len(mail.outbox) == 2
assert "Email address has been added." in mail.outbox[1].body


@patch("allauth.account.app_settings.ACCOUNT_EMAIL_NOTIFICATIONS", True)
def test_notification_on_email_remove(auth_client, user):
secondary = EmailAddress.objects.create(
Expand Down
5 changes: 0 additions & 5 deletions allauth/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,6 @@ def form_valid(self, form):
user=self.request.user,
email_address=email_address,
)
adapter.send_notification_mail(
"account/email/email_added",
self.request.user,
{"email": email_address.email},
)
return super(EmailView, self).form_valid(form)

def post(self, request, *args, **kwargs):
Expand Down
5 changes: 4 additions & 1 deletion allauth/mfa/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def wrap(self):
from allauth.mfa.recovery_codes import RecoveryCodes
from allauth.mfa.totp import TOTP

return {self.Type.TOTP: TOTP, self.Type.RECOVERY_CODES: RecoveryCodes,}[
return {
self.Type.TOTP: TOTP,
self.Type.RECOVERY_CODES: RecoveryCodes,
}[
self.type
](self)

Expand Down
4 changes: 0 additions & 4 deletions allauth/templates/account/email/email_added_message.txt

This file was deleted.

4 changes: 0 additions & 4 deletions allauth/templates/account/email/email_added_subject.txt

This file was deleted.

0 comments on commit 000c971

Please sign in to comment.