Пример #1
0
 def _checkProtection(self):
     base.RH._checkProtection(self)
     minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
     if minfo.getModerateAccountCreation():
         raise UserError(
             "Impossible to send activation email because the account creation is moderated"
         )
Пример #2
0
 def add(self, newId):
     if self.hasKey(newId.getId()):
         raise UserError(_("identity already exists"))
     id = newId.getId()
     tree = self._getIdx()
     if tree.has_key(id):
         raise UserError
     tree[id] = newId
     return id
Пример #3
0
    def add(self, newId):
        """ Add a new Id to the ObjectHolder.
            Returns the identity Id.

            :param newId: a PIdentity object that contains the user and login
            :type newId: MaKaC.baseAuthentication.PIdentity child class
        """

        if self.hasKey(newId.getId()):
            raise UserError(_("identity already exists"))
        id = newId.getId()
        tree = self._getIdx()
        if tree.has_key(id):
            raise UserError
        tree[id] = newId
        return id