VirtualMailManager/VirtualMailManager.py
changeset 238 8f56166a3283
parent 231 8c4df3dd2d2c
child 258 9bf8d97ced88
equal deleted inserted replaced
231:8c4df3dd2d2c 238:8f56166a3283
   571         from Domain import search
   571         from Domain import search
   572         like = False
   572         like = False
   573         if pattern is not None:
   573         if pattern is not None:
   574             if pattern.startswith('%') or pattern.endswith('%'):
   574             if pattern.startswith('%') or pattern.endswith('%'):
   575                 like = True
   575                 like = True
   576                 if pattern.startswith('%') and pattern.endswith('%'):
   576                 domain = pattern.strip('%')
   577                     domain = pattern[1:-1]
       
   578                 elif pattern.startswith('%'):
       
   579                     domain = pattern[1:]
       
   580                 elif pattern.endswith('%'):
       
   581                     domain = pattern[:-1]
       
   582                 if not re.match(RE_DOMAIN_SRCH, domain):
   577                 if not re.match(RE_DOMAIN_SRCH, domain):
   583                     raise VMMException(
   578                     raise VMMException(
   584                     _(u"The pattern ā€œ%sā€ contains invalid characters.") %
   579                     _(u"The pattern ā€œ%sā€ contains invalid characters.") %
   585                     pattern, ERR.DOMAIN_INVALID)
   580                     pattern, ERR.DOMAIN_INVALID)
   586         self.__dbConnect()
   581         self.__dbConnect()