VirtualMailManager/domain.py
branchv0.6.x
changeset 417 8209da83e256
parent 404 0c52094447b0
child 441 1af5fe0683ce
equal deleted inserted replaced
416:f32b323fd347 417:8209da83e256
   109 
   109 
   110     def _chk_state(self):
   110     def _chk_state(self):
   111         """Throws a DomainError if the Domain is new - not saved in the
   111         """Throws a DomainError if the Domain is new - not saved in the
   112         database."""
   112         database."""
   113         if self._new:
   113         if self._new:
   114             raise DomErr(_(u"The domain '%s' doesn't exist.") % self._name,
   114             raise DomErr(_(u"The domain '%s' does not exist.") % self._name,
   115                          NO_SUCH_DOMAIN)
   115                          NO_SUCH_DOMAIN)
   116 
   116 
   117     def _update_tables(self, column, value, force=False):
   117     def _update_tables(self, column, value, force=False):
   118         """Update various columns in the domain_data table. When *force* is
   118         """Update various columns in the domain_data table. When *force* is
   119         `True` also the corresponding column in the users table will be
   119         `True` also the corresponding column in the users table will be
   267         `force` : bool
   267         `force` : bool
   268           enforce new quota limit for all accounts, default `False`
   268           enforce new quota limit for all accounts, default `False`
   269         """
   269         """
   270         if cfg_dget('misc.dovecot_version') < 0x10102f00:
   270         if cfg_dget('misc.dovecot_version') < 0x10102f00:
   271             raise VMMError(_(u'PostgreSQL-based dictionary quota requires '
   271             raise VMMError(_(u'PostgreSQL-based dictionary quota requires '
   272                              u'Dovecot >= v1.1.2'), VMM_ERROR)
   272                              u'Dovecot >= v1.1.2.'), VMM_ERROR)
   273         self._chk_state()
   273         self._chk_state()
   274         assert isinstance(quotalimit, QuotaLimit)
   274         assert isinstance(quotalimit, QuotaLimit)
   275         if not force and quotalimit == self._qlimit:
   275         if not force and quotalimit == self._qlimit:
   276             return
   276             return
   277         self._update_tables('qid', quotalimit.qid, force)
   277         self._update_tables('qid', quotalimit.qid, force)