From c702b1b24d05c80d48b235106932dd507c565dc8 Mon Sep 17 00:00:00 2001 From: Humberto Rocha Date: Wed, 15 Mar 2023 20:46:12 -0400 Subject: [PATCH] Always return voters_count (#543) --- activities/models/post_types.py | 2 +- tests/api/test_statuses.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activities/models/post_types.py b/activities/models/post_types.py index b4e58f6..8db2dc8 100644 --- a/activities/models/post_types.py +++ b/activities/models/post_types.py @@ -58,7 +58,7 @@ class QuestionData(BasePostDataType): "expired": False, "multiple": multiple, "votes_count": 0, - "voters_count": self.voter_count if multiple else None, + "voters_count": self.voter_count, "voted": False, "own_votes": [], "options": [], diff --git a/tests/api/test_statuses.py b/tests/api/test_statuses.py index 4add2af..01ce58b 100644 --- a/tests/api/test_statuses.py +++ b/tests/api/test_statuses.py @@ -131,7 +131,7 @@ def test_question_format(api_client, remote_identity): "expired": True, "multiple": False, "votes_count": 30, - "voters_count": None, + "voters_count": 30, "voted": False, "own_votes": [], "options": [