diff --git a/src/postorius/utils.py b/src/postorius/utils.py index dc681dd..93c991b 100644 --- a/src/postorius/utils.py +++ b/src/postorius/utils.py @@ -34,25 +34,3 @@ return render(request, 'postorius/errors/generic.html', {'error': _('Mailman REST API not available. ' 'Please start Mailman core.')}) - - -def set_other_emails(user): - from postorius.models import MailmanUser, MailmanApiError, Mailman404Error - if hasattr(user, 'other_emails'): - return - user.other_emails = [] - if not user.is_authenticated(): - return - try: - mm_user = MailmanUser.objects.get(address=user.email) - user.other_emails = [str(address) for address in mm_user.addresses - if address.verified_on is not None] - except (MailmanApiError, Mailman404Error, AttributeError) as e: - # MailmanApiError: No connection to Mailman - # Mailman404Error: The user does not have a mailman user associated - # AttributeError: Anonymous user - logger.warning("Mailman error while setting other emails for %s: %r", - user.email, e) - return - if user.email in user.other_emails: - user.other_emails.remove(user.email) diff --git a/src/postorius/views/generic.py b/src/postorius/views/generic.py index 8fc86de..851d1cd 100644 --- a/src/postorius/views/generic.py +++ b/src/postorius/views/generic.py @@ -86,13 +86,6 @@ user_obj.first_address = self._get_first_address(user_obj) return user_obj - def _get_list(self, list_id): - if getattr(self, 'lists', None) is None: - self.lists = {} - if self.lists.get(list_id) is None: - self.lists[list_id] = List.objects.get(fqdn_listname=list_id) - return self.lists[list_id] - def _get_memberships(self): memberships = [] for m in self.mm_user.subscriptions: