summaryrefslogtreecommitdiff
path: root/jimbrella/users.py
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-27 23:07:55 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-27 23:07:55 +0800
commita42cefbbee178498afdd65ae0f774c2cdd99493f (patch)
tree6db5b3f5edcd7fc98458478713b0f14e51e9c466 /jimbrella/users.py
parent4d35e9f2a36d1e0c938a985d4afffcb6ee99c193 (diff)
Admin console requires login to admin account
Diffstat (limited to 'jimbrella/users.py')
-rw-r--r--jimbrella/users.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/jimbrella/users.py b/jimbrella/users.py
index c68908f..3276062 100644
--- a/jimbrella/users.py
+++ b/jimbrella/users.py
@@ -72,3 +72,13 @@ class Users(CsvTable):
"email": "",
}
self._append(user)
+
+ def find(self, username) -> dict:
+ """Find a user and return it in its `dict` structure."""
+
+ users = self._read()
+ for user in users:
+ if user["username"] == username:
+ return user
+
+ return None