From a42cefbbee178498afdd65ae0f774c2cdd99493f Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Wed, 27 Oct 2021 23:07:55 +0800 Subject: Admin console requires login to admin account --- jimbrella/users.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'jimbrella/users.py') 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 -- cgit v1.2.3