Opened 15 years ago
Closed 12 years ago
#12018 closed New feature (wontfix)
Use "RequestContext" instead of "Context" for comments moderation email
Reported by: | Charlie DeTar | Owned by: | nobody |
---|---|---|---|
Component: | contrib.comments | Version: | dev |
Severity: | Normal | Keywords: | dceu2011 |
Cc: | chazen@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The django.contrib.comments moderation framework allows users to send an email to site admins when a comment is posted. The email is formatted using the template "comments/comment_notification_email.txt". However, this template is rendered using a Context object, not RequestContext, making it impossible to add additional context parameters for the template renderer.
An example of the type of additional context one might want in an email is a site url, allowing the template to provide a link to the comment or admin functions on the site.
Attachments (3)
Change History (13)
by , 15 years ago
Attachment: | comments_request_context.diff added |
---|
comment:1 by , 15 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Agreed -- 'extra_context' would be useful; but both would be better. RequestContext allows the context processors defined in settings.py to contribute to the context (including MEDIA_URL, etc); thus one could get extra context by adding additional context processors (at the expense of these appearing for other requests as well). 'extra_context' would allow additional parameters beyond that, or specific parameters for this case.
by , 14 years ago
Attachment: | comments_request_context2.diff added |
---|
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
UI/UX: | unset |
Version: | 1.1 → SVN |
Not a valid patch because RequestContext's first argument must be the request object.
comment:6 by , 13 years ago
Keywords: | dceu2011 added |
---|---|
Patch needs improvement: | unset |
Latest patch includes tests.
comment:7 by , 13 years ago
I'd argue email shouldn't be send in the request/response cycle. You often have to send e-mails outside of it.
comment:8 by , 13 years ago
@hvdklauw: This patch has nothing to do with the sending of mail, it only provides the comment notification template access to the RequestContext and thus the various context processors that might have been written.
comment:10 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → 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.
As pointed out by mattmcc on IRC, this ticket doesn't address the requirement for an 'extra_context' argument. So even though a RequestContext is used, it gives access to the Request object but the context cannot be customized further.