Binary file not shown.
@@ -22,7 +22,7 @@ def dump():
|
||||
printr(statistics_text[-1])
|
||||
print("\n".join(statistics_text))
|
||||
all_content = ""
|
||||
for user in db.get_users():
|
||||
for user in list(db.get_users()):
|
||||
text = (
|
||||
db.get_all_rants_of_user(user)
|
||||
)
|
||||
|
||||
+6
-6
@@ -282,16 +282,16 @@ def get_contribution_average_per_user():
|
||||
|
||||
|
||||
def get_all_rants_of_user(username):
|
||||
with Db() as db:
|
||||
with Db() as _db:
|
||||
try:
|
||||
return db.db["rants_of_user"].find_one(username=username)["text"]
|
||||
except TypeError:
|
||||
return list(_db.db["rants_of_user"].find(username=username))[0]["text"]
|
||||
except IndexError:
|
||||
return ""
|
||||
|
||||
|
||||
def get_all_posts_of_user(username):
|
||||
with Db() as db:
|
||||
with Db() as _db:
|
||||
try:
|
||||
return db.db["posts_of_user"].find_one(username=username)["text"]
|
||||
except TypeError:
|
||||
return list(_db.db["posts_of_user"].find(username=username))[0]["text"]
|
||||
except IndexError:
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user