VirtualMailManager/handler.py
branchv0.6.x
changeset 539 5806fb74130b
parent 536 c340ba4bd544
child 555 499c63f52462
equal deleted inserted replaced
538:1f9ea5658627 539:5806fb74130b
   482 
   482 
   483         dom = self._get_domain(domainname)
   483         dom = self._get_domain(domainname)
   484         serviceset = ServiceSet(self._dbh, **kwargs)
   484         serviceset = ServiceSet(self._dbh, **kwargs)
   485         dom.update_serviceset(serviceset, (True, False)[not force])
   485         dom.update_serviceset(serviceset, (True, False)[not force])
   486 
   486 
   487     def domain_transport(self, domainname, transport, force=None):
   487     def domain_note(self, domainname, note):
   488         """Wrapper around Domain.update_transport()"""
   488         """Wrapper around Domain.update_transport()"""
   489         if force is not None and force != 'force':
       
   490             raise DomainError(_(u"Invalid argument: '%s'") % force,
       
   491                               INVALID_ARGUMENT)
       
   492         dom = self._get_domain(domainname)
   489         dom = self._get_domain(domainname)
   493         trsp = Transport(self._dbh, transport=transport)
   490         dom.update_note(note)
   494         if force is None:
       
   495             dom.update_transport(trsp)
       
   496         else:
       
   497             dom.update_transport(trsp, force=True)
       
   498 
   491 
   499     def domain_delete(self, domainname, force=False):
   492     def domain_delete(self, domainname, force=False):
   500         """Wrapper around Domain.delete()"""
   493         """Wrapper around Domain.delete()"""
   501         if not isinstance(force, bool):
   494         if not isinstance(force, bool):
   502             raise TypeError('force must be a bool')
   495             raise TypeError('force must be a bool')
   756         if not acc:
   749         if not acc:
   757             raise VMMError(_(u"The account '%s' does not exist.") %
   750             raise VMMError(_(u"The account '%s' does not exist.") %
   758                            acc.address, NO_SUCH_ACCOUNT)
   751                            acc.address, NO_SUCH_ACCOUNT)
   759         acc.modify('name', name)
   752         acc.modify('name', name)
   760 
   753 
       
   754     def user_note(self, emailaddress, note):
       
   755         """Wrapper for Account.modify('note', ...)."""
       
   756         acc = self._get_account(emailaddress)
       
   757         if not acc:
       
   758             raise VMMError(_(u"The account '%s' does not exist.") %
       
   759                            acc.address, NO_SUCH_ACCOUNT)
       
   760         acc.modify('note', note)
       
   761 
   761     def user_quotalimit(self, emailaddress, bytes_, messages=0):
   762     def user_quotalimit(self, emailaddress, bytes_, messages=0):
   762         """Wrapper for Account.update_quotalimit(QuotaLimit)."""
   763         """Wrapper for Account.update_quotalimit(QuotaLimit)."""
   763         acc = self._get_account(emailaddress)
   764         acc = self._get_account(emailaddress)
   764         if not acc:
   765         if not acc:
   765             raise VMMError(_(u"The account '%s' does not exist.") %
   766             raise VMMError(_(u"The account '%s' does not exist.") %