From d13ab3ba6e9d882f6504f8ca43bed1769c86150a Mon Sep 17 00:00:00 2001 From: Thomas Wade Date: Tue, 21 Apr 2020 05:12:08 +0930 Subject: [PATCH] Actually use the user cache --- User.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/User.py b/User.py index 2dadf4a..b9bfffe 100644 --- a/User.py +++ b/User.py @@ -57,10 +57,10 @@ class User: @staticmethod def new_or_cached(api, username: str): # -> User: - if username in User._usercache: - return User._usercache[username] + if username not in User._usercache: + User._usercache[username] = User(api, username) - return User(api, username) + return User._usercache[username] def _get_gallery(self) -> List[Submission.Submission]: submissions = []