|
@@ -30,13 +30,13 @@ class User(object): |
|
|
self._emailable = None |
|
|
self._emailable = None |
|
|
self._gender = None |
|
|
self._gender = None |
|
|
|
|
|
|
|
|
def _get_attribute(self, attr, force): |
|
|
|
|
|
|
|
|
def _get_attribute(self, attr, force, raise_exception=True): |
|
|
""" |
|
|
""" |
|
|
Docstring needed |
|
|
Docstring needed |
|
|
""" |
|
|
""" |
|
|
if self._exists is None or force: |
|
|
if self._exists is None or force: |
|
|
self._load_attributes() |
|
|
self._load_attributes() |
|
|
if self._exists is False: |
|
|
|
|
|
|
|
|
if self._exists is False and raise_exception: |
|
|
e = "User '{0}' does not exist.".format(self._name) |
|
|
e = "User '{0}' does not exist.".format(self._name) |
|
|
raise UserNotFoundError(e) |
|
|
raise UserNotFoundError(e) |
|
|
return getattr(self, attr) |
|
|
return getattr(self, attr) |
|
@@ -84,13 +84,13 @@ class User(object): |
|
|
""" |
|
|
""" |
|
|
Docstring needed |
|
|
Docstring needed |
|
|
""" |
|
|
""" |
|
|
return self._get_attribute("_name", force) |
|
|
|
|
|
|
|
|
return self._get_attribute("_name", force, raise_exception=False) |
|
|
|
|
|
|
|
|
def exists(self, force=False): |
|
|
def exists(self, force=False): |
|
|
""" |
|
|
""" |
|
|
Docstring needed |
|
|
Docstring needed |
|
|
""" |
|
|
""" |
|
|
return self._get_attribute("_exists", force) |
|
|
|
|
|
|
|
|
return self._get_attribute("_exists", force, raise_exception=False) |
|
|
|
|
|
|
|
|
def userid(self, force=False): |
|
|
def userid(self, force=False): |
|
|
""" |
|
|
""" |
|
|