Fix plural form in email

This commit is contained in:
Gabriel Augendre 2020-08-19 12:22:30 +02:00
parent d5d4efd2df
commit 7acb6c0863

View file

@ -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)