fix and test TOTAL_USERS count

Don't assume UserDict contains all users

which assumption led to double-counting when a user in the db was loaded into the dict cache
This commit is contained in:
Min RK
2020-11-30 13:27:52 +01:00
parent 18393ec6b4
commit 7e469f911d
5 changed files with 40 additions and 1 deletions

View File

@@ -69,7 +69,6 @@ class UserDict(dict):
"""Add a user to the UserDict"""
if orm_user.id not in self:
self[orm_user.id] = self.from_orm(orm_user)
TOTAL_USERS.inc()
return self[orm_user.id]
def __contains__(self, key):