Add user getattr to make config access easier

This commit is contained in:
Tim Van Baak 2020-01-15 17:16:09 -08:00
parent 634c00ae53
commit f59716e096
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,11 @@ class User(UserMixin):
with config.json_ro(self.config_path) as j:
self.config = j
def __getattr__(self, key):
if key not in self.config:
raise AttributeError(key)
return self.config.get(key)
def get_id(self):
return self.uid