diff options
-rw-r--r-- | service/pixelated/account_recovery.py | 5 | ||||
-rw-r--r-- | service/pixelated/assets/recovery.mail.en-US | 8 | ||||
-rw-r--r-- | service/pixelated/assets/recovery.mail.pt-BR | 8 | ||||
-rw-r--r-- | service/test/unit/test_account_recovery.py | 4 |
4 files changed, 10 insertions, 15 deletions
diff --git a/service/pixelated/account_recovery.py b/service/pixelated/account_recovery.py index dae3da1b..f84aea1a 100644 --- a/service/pixelated/account_recovery.py +++ b/service/pixelated/account_recovery.py @@ -24,8 +24,6 @@ from twisted.mail import smtp from email import message_from_string from email.utils import formatdate -from pixelated.resources.account_recovery_resource import AccountRecoveryResource - log = Logger() @@ -77,13 +75,10 @@ class AccountRecovery(object): 'pixelated.assets', 'recovery.mail.%s' % (self._language)) - account_recovery_url = '{}/{}'.format(self._domain, AccountRecoveryResource.BASE_URL) - with open(recovery_mail) as mail_template_file: return message_from_string(mail_template_file.read().format( domain=self._domain, recovery_code=binascii.hexlify(code), - account_recovery_url=account_recovery_url, backup_email=backup_email, sender=sender, date=formatdate(localtime=True))) diff --git a/service/pixelated/assets/recovery.mail.en-US b/service/pixelated/assets/recovery.mail.en-US index 8e12c55d..a2e5b1e8 100644 --- a/service/pixelated/assets/recovery.mail.en-US +++ b/service/pixelated/assets/recovery.mail.en-US @@ -1,13 +1,13 @@ From: {sender} Date: {date} -Subject: Recovery Code +Subject: Recovery Code for {domain} To: {backup_email} Content-Type: text/plain; charset=UTF-8 Hello, -You are receiving this email because you registered at a Pixelated provider, on {domain}. -In case you ever forget your password, you can access this link {account_recovery_url} and put the following recovery code: +You are receiving this email because you registered at a Pixelated provider, on https://{domain}. +In case you ever forget your password use the following recovery code: {recovery_code} @@ -23,4 +23,4 @@ This code is half of a big code to recover your account, the other half is with You will only succeed if you have both codes, so, never hurts to ask again: SAVE THIS CODE! -PS: If you didn't create an account at {domain}, please ignore this email. +PS: If you didn't create an account at https://{domain}, please ignore this email. diff --git a/service/pixelated/assets/recovery.mail.pt-BR b/service/pixelated/assets/recovery.mail.pt-BR index 7d0f2a58..c608cb0b 100644 --- a/service/pixelated/assets/recovery.mail.pt-BR +++ b/service/pixelated/assets/recovery.mail.pt-BR @@ -1,13 +1,13 @@ From: {sender} Date: {date} -Subject: Codigo de Recuperacao +Subject: Codigo de Recuperacao de {domain} To: {backup_email} Content-Type: text/plain; charset=UTF-8 Olá, -Você está recebendo este email porque você se registrou em um provedor do Pixelated, no {domain}. -Se algum dia esquecer sua senha, você pode acessar esse link {account_recovery_url} e usar o código abaixo: +Você está recebendo este email porque você se registrou em um provedor do Pixelated, no https://{domain}. +Se algum dia esquecer sua senha use o código abaixo: {recovery_code} @@ -23,4 +23,4 @@ Nós entedemos que esquecer a senha é algo comum, por isso desenvolvemos uma fo Esse código é uma metade do código necesário para recuperar a conta. A outra metade está com o administrador da conta. Se você esquecer a senha, use esse código e o do administrador para recuperar acesso a conta. É como se fosse um cadeado com duas chaves :) Você só terá sucesso se tiver ambos os códigos, então, nunca machuca pedir novamente: GUARDE ESSE CÓDIGO! -PS: Se você não criou uma conta no site {domain}, por favor ignore esse email. +PS: Se você não criou uma conta no site https://{domain}, por favor ignore esse email. diff --git a/service/test/unit/test_account_recovery.py b/service/test/unit/test_account_recovery.py index cb5ed520..e9979fae 100644 --- a/service/test/unit/test_account_recovery.py +++ b/service/test/unit/test_account_recovery.py @@ -94,8 +94,8 @@ class AccountRecoveryTest(unittest.TestCase): mock_formatdate.return_value = 'Sat, 21 Mar 2015 19:30:09 -0300' sender = 'team@{}'.format(self.domain) - mock_file_content = '{backup_email}, {sender}, {date}, {domain}, {recovery_code}, {account_recovery_url}' - recovery_code_email = '\ntest@test.com, team@test.com, Sat, 21 Mar 2015 19:30:09 -0300, test.com, 34363435613266383939376535643064, test.com/account-recovery' + mock_file_content = '{backup_email}, {sender}, {date}, {domain}, {recovery_code}' + recovery_code_email = '\ntest@test.com, team@test.com, Sat, 21 Mar 2015 19:30:09 -0300, test.com, 34363435613266383939376535643064' with patch('pixelated.account_recovery.open', mock_open(read_data=mock_file_content), create=True): yield self.account_recovery._send_mail(self.generated_code, self.backup_email) |