Bugfix
dR export statistics / Compile (push) Successful in 4m25s

This commit is contained in:
2024-11-24 08:39:56 +01:00
parent 0cdaabfa5d
commit 79ca90597c
12 changed files with 6975 additions and 16 deletions
Binary file not shown.
+1 -1
View File
@@ -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
View File
@@ -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 ""