VirtualMailManager/handler.py
branchv0.6.x
changeset 536 c340ba4bd544
parent 533 2676dbf43e1c
child 539 5806fb74130b
equal deleted inserted replaced
535:e956ddc868c0 536:c340ba4bd544
   750                            acc.address, NO_SUCH_ACCOUNT)
   750                            acc.address, NO_SUCH_ACCOUNT)
   751         acc.modify('password', password)
   751         acc.modify('password', password)
   752 
   752 
   753     def user_name(self, emailaddress, name):
   753     def user_name(self, emailaddress, name):
   754         """Wrapper for Account.modify('name', ...)."""
   754         """Wrapper for Account.modify('name', ...)."""
   755         if not isinstance(name, basestring) or not name:
       
   756             raise VMMError(_(u"Could not accept name: '%s'") % name,
       
   757                            INVALID_ARGUMENT)
       
   758         acc = self._get_account(emailaddress)
   755         acc = self._get_account(emailaddress)
   759         if not acc:
   756         if not acc:
   760             raise VMMError(_(u"The account '%s' does not exist.") %
   757             raise VMMError(_(u"The account '%s' does not exist.") %
   761                            acc.address, NO_SUCH_ACCOUNT)
   758                            acc.address, NO_SUCH_ACCOUNT)
   762         acc.modify('name', name)
   759         acc.modify('name', name)