Fix: Use proper error when linking external partner accounts

This commit is contained in:
Adrià Casajús 2023-08-30 13:49:47 +02:00
parent c04f5102d6
commit ef90423a35
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ from app.utils import sanitize_email
from app.errors import (
AccountAlreadyLinkedToAnotherPartnerException,
AccountIsUsingAliasAsEmail,
AccountAlreadyLinkedToAnotherUserException,
)
from app.log import LOG
from app.models import (
@ -179,7 +180,7 @@ class ExistingUnlinkedUserStrategy(ClientMergeStrategy):
class LinkedWithAnotherPartnerUserStrategy(ClientMergeStrategy):
def process(self) -> LinkResult:
raise AccountAlreadyLinkedToAnotherPartnerException()
raise AccountAlreadyLinkedToAnotherUserException()
def get_login_strategy(

View File

@ -35,7 +35,7 @@ class UnsubscribeGenerator:
LOG.info("Email has no unsubscribe header")
return message
if isinstance(unsubscribe_data, Header):
unsubscribe_data = str(unsubscribe_data.encode)
unsubscribe_data = str(unsubscribe_data.encode())
raw_methods = [method.strip() for method in unsubscribe_data.split(",")]
mailto_unsubs = None
other_unsubs = []