Actually use the user cache
This commit is contained in:
parent
69ff0a40b8
commit
d13ab3ba6e
6
User.py
6
User.py
@ -57,10 +57,10 @@ class User:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def new_or_cached(api, username: str): # -> User:
|
def new_or_cached(api, username: str): # -> User:
|
||||||
if username in User._usercache:
|
if username not in User._usercache:
|
||||||
return User._usercache[username]
|
User._usercache[username] = User(api, username)
|
||||||
|
|
||||||
return User(api, username)
|
return User._usercache[username]
|
||||||
|
|
||||||
def _get_gallery(self) -> List[Submission.Submission]:
|
def _get_gallery(self) -> List[Submission.Submission]:
|
||||||
submissions = []
|
submissions = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user