def activate(self):
self._set_attribute("activated", True)
- def set_passphrase(self, passphrase):
- """
- Update the passphrase the users uses to log on.
- """
- # We cannot set the password for ldap users
- if self.ldap_dn:
- raise AttributeError("Cannot set passphrase for LDAP user")
-
- self.db.execute("UPDATE users SET passphrase = %s WHERE id = %s",
- generate_password_hash(passphrase), self.id)
-
- passphrase = property(lambda x: None, set_passphrase)
-
def get_realname(self):
return self.data.realname or self.name
timezone = property(get_timezone, set_timezone)
- @property
- def activated(self):
- return self.data.activated
-
@property
def deleted(self):
return self.data.deleted