Skip to content

Commit

Permalink
feat(forum): add comment in queryset annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jan 2, 2023
1 parent 2148c37 commit 44865b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lacommunaute/forum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def count_engaged_users(self):
)
authenticated_users = posters | likers | voters

# Anonymous post are not linked to user. Legacy Machina `username` field is overriden to store
# the email of anonymous poster. As long we want to deduplicate email list between authenticated
# and anonymous users, `username` field is renamed `email` in this annoted queryset.
anonymous_posters = (
Post.objects.filter(topic__forum__in=forums)
.exclude(username__isnull=True)
Expand Down

0 comments on commit 44865b5

Please sign in to comment.