diff --git a/app/models.py b/app/models.py index 2657ea9..d7ed94c 100644 --- a/app/models.py +++ b/app/models.py @@ -38,7 +38,7 @@ class Users(Model): def get_post_stats(self): q = """SELECT - COUNT(posts.id) AS post_count, + COUNT(DISTINCT posts.id) AS post_count, COUNT(DISTINCT threads.id) AS thread_count, MAX(threads.title) FILTER (WHERE threads.created_at = latest.created_at) AS latest_thread_title, MAX(threads.slug) FILTER (WHERE threads.created_at = latest.created_at) AS latest_thread_slug