From 7acb6c0863ea6b91d2a914eabb74b116684b6cb7 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 19 Aug 2020 12:22:30 +0200 Subject: [PATCH] Fix plural form in email --- articles/management/commands/check_pending_comments.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/articles/management/commands/check_pending_comments.py b/articles/management/commands/check_pending_comments.py index 2090c39..8e90f8d 100644 --- a/articles/management/commands/check_pending_comments.py +++ b/articles/management/commands/check_pending_comments.py @@ -16,5 +16,8 @@ class Command(BaseCommand): url = (settings.BLOG["base_url"] + url).replace( "//", "/" ) + "?status__exact=pending" - message = f"There are {count} comments pending review.\n{url}" + comments = "comment" + if count > 1: + comments += "s" + message = f"There are {count} {comments} pending review.\n{url}" mail_admins("Comments pending", message)