Skip to content

Commit

Permalink
Fix counting of requests with updates
Browse files Browse the repository at this point in the history
  • Loading branch information
noeddl authored and pajowu committed Jan 22, 2025
1 parent 375ba36 commit dc61554
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions froide/foirequest/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ def key_func(n):
def send_update(notifications: List[Notification], user):
translation.activate(user.language or settings.LANGUAGE_CODE)

count = len(notifications)
subject = ngettext_lazy(
"Update on one of your request", "Update on %(count)s of your requests", count
) % {"count": count}

# Add additional info to template context
request_list = []
grouped_notifications = groupby(notifications, lambda n: n.object.id)
Expand All @@ -146,6 +141,11 @@ def send_update(notifications: List[Notification], user):
if not request_list:
return

count = len(request_list)
subject = ngettext_lazy(
"Update on one of your request", "Update on %(count)s of your requests", count
) % {"count": count}

update_requester_email.send(
user=user,
subject=subject,
Expand Down

0 comments on commit dc61554

Please sign in to comment.