Code

Opened 4 years ago

Closed 16 months ago

#14646 closed Bug (wontfix)

django.contrib.comments is missing default template for comment_notification_email.txt, and has no documentation of template context

Reported by: tpherndon Owned by: tzulberti
Component: contrib.comments Version: master
Severity: Normal Keywords: email, template
Cc: jefferya@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

When using moderation and having set email_notification to True, posting a comment results in an error complaining that there is no template for 'comments/comment_notification_email.txt'. In addition, there is no mention in the documentation that creating that template is required to use email notifications, nor what context is passed by default into the template (that is, no instructions for what should go in the template).

I would expect that either a default template would be included with Django, or explicit instructions would inform the user that they need to create the template and what would need to go in it.

Attachments (2)

14646_comment_notification_email_template_fix.diff (1.5 KB) - added by tpherndon 4 years ago.
Adds default comment_notification_email.txt template and updates documentation.
14646_comment_notification_email_template_fix.2.diff (1.5 KB) - added by fest 4 years ago.
A better patch that shows user's name and e-mail even if comment was posted by authenticated user.

Download all attachments as: .zip

Change History (13)

Changed 4 years ago by tpherndon

Adds default comment_notification_email.txt template and updates documentation.

comment:1 Changed 4 years ago by tpherndon

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to tpherndon
  • Patch needs improvement unset

comment:2 Changed 4 years ago by tpherndon

  • Has patch set

comment:3 Changed 4 years ago by tzulberti

  • Owner changed from tpherndon to tzulberti

comment:4 Changed 4 years ago by tzulberti

  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

The documentation is ok. I don't kwow about the template (at least, for me it is ok)

Changed 4 years ago by fest

A better patch that shows user's name and e-mail even if comment was posted by authenticated user.

comment:5 Changed 4 years ago by fest

The attached template for e-mail does not show user name and e-mail if the comment was posted by authenticated user.
I attached a fixed template which shows user's name and e-mail regardless if comment was posted by anonymous or authenticated user.

comment:6 Changed 3 years ago by julien

  • Needs tests set

The template needs to be localized and tests need to be added.

comment:7 Changed 3 years ago by jaddison

  • Severity set to Normal
  • Type set to Bug

comment:8 Changed 3 years ago by thejaswi_puthraya

  • Easy pickings unset
  • UI/UX unset

Slightly dependent on #12018. With a request context, the docs in the patch will have to be updated.

comment:9 Changed 2 years ago by programmerq

  • Needs tests unset

As for the tests, all that would have to be done is remove the template that is used by the tests: https://github.com/django/django/blob/master/tests/templates/comments/comment_notification_email.txt

The tests currently use that to test the email functionality. If that file is removed, the test breaks. If that file is removed and the new template is checked in to django.contrib.comments, then the test will pass again.

comment:10 Changed 2 years ago by programmerq

  • Cc jefferya@… added

comment:11 Changed 16 months ago by jacob

  • Resolution set to wontfix
  • Status changed from new to closed

django.contrib.comments has been deprecated and is no longer supported, so I'm closing this ticket. We're encouraging users to transition to a custom solution, or to a hosted solution like Disqus.

The code itself has moved to https://github.com/django/django-contrib-comments; if you want to keep using it, you could move this bug over there.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.