aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-10-18 19:42:39 +0100
committerGravatar GitHub <[email protected]>2020-10-18 19:42:39 +0100
commitd0853d28b34789756d03f414dc33fa84bc774142 (patch)
tree7743f4cfecf2c0e4a071f9d00651aed9f9059443 /pydis_site/apps
parentExclude deleted messages from total message count (diff)
Split query into multiple lines for total messages
Diffstat (limited to 'pydis_site/apps')
-rw-r--r--pydis_site/apps/api/models/bot/metricity.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py
index cdfbb499..eed1deb4 100644
--- a/pydis_site/apps/api/models/bot/metricity.py
+++ b/pydis_site/apps/api/models/bot/metricity.py
@@ -33,7 +33,10 @@ class Metricity:
def total_messages(self, user_id: str) -> int:
"""Query total number of messages for a user."""
- self.cursor.execute("SELECT COUNT(*) FROM messages WHERE author_id = '%s' AND NOT is_deleted", [user_id])
+ self.cursor.execute(
+ "SELECT COUNT(*) FROM messages WHERE author_id = '%s' AND NOT is_deleted",
+ [user_id]
+ )
values = self.cursor.fetchone()
if not values: