Exemple #1
0
 def create(self, store, fqdn_listname):
     """See `IListManager`."""
     fqdn_listname = fqdn_listname.lower()
     listname, at, hostname = fqdn_listname.partition('@')
     if len(hostname) == 0:
         raise InvalidEmailAddressError(fqdn_listname)
     list_id = '{0}.{1}'.format(listname, hostname)
     notify(ListCreatingEvent(fqdn_listname))
     mlist = store.query(MailingList).filter_by(_list_id=list_id).first()
     if mlist:
         raise ListAlreadyExistsError(fqdn_listname)
     mlist = MailingList(fqdn_listname)
     mlist.created_at = now()
     store.add(mlist)
     notify(ListCreatedEvent(mlist))
     return mlist
Exemple #2
0
 def create(self, store, fqdn_listname):
     """See `IListManager`."""
     fqdn_listname = fqdn_listname.lower()
     listname, at, hostname = fqdn_listname.partition('@')
     if len(hostname) == 0:
         raise InvalidEmailAddressError(fqdn_listname)
     list_id = '{}.{}'.format(listname, hostname)
     notify(ListCreatingEvent(fqdn_listname))
     mlist = store.query(MailingList).filter_by(_list_id=list_id).first()
     if mlist:
         raise ListAlreadyExistsError(fqdn_listname)
     mlist = MailingList(fqdn_listname)
     mlist.created_at = now()
     store.add(mlist)
     notify(ListCreatedEvent(mlist))
     return mlist
Exemple #3
0
 def create(self, store, fqdn_listname):
     """See `IListManager`."""
     listname, at, hostname = fqdn_listname.partition('@')
     if len(hostname) == 0:
         raise InvalidEmailAddressError(fqdn_listname)
     notify(ListCreatingEvent(fqdn_listname))
     mlist = store.find(
         MailingList,
         MailingList.list_name == listname,
         MailingList.mail_host == hostname).one()
     if mlist:
         raise ListAlreadyExistsError(fqdn_listname)
     mlist = MailingList(fqdn_listname)
     mlist.created_at = now()
     store.add(mlist)
     notify(ListCreatedEvent(mlist))
     return mlist