Remove obsolete functions
1 parent 3e5bc17 commit 1986bf9a79efe3935c12430abbe270935a96f8ef
@Aurélien Bompard Aurélien Bompard authored on 13 Aug 2016
Showing 2 changed files
View
22
src/postorius/utils.py
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)
View
7
src/postorius/views/generic.py
user_obj.display_name = ''
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:
if m.role != "member":