Django

Code

Ticket #5615 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Typo in email docs: "to" field should be a list

Reported by: raprasad@gmail.com Assigned to: nobody
Milestone: Component: Documentation
Version: SVN Keywords: email to
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

documentation typo on:

http://www.djangoproject.com/documentation/email/#sending-alternative-content-types

The "to" address is not a list:

-fix 1-

orig:

subject, from_email, to = 'hello', 'from@example.com', 'to@example.com'

new:

subject, from_email, to = 'hello', 'from@example.com', ['to@example.com']

--- OR ---

-fix 2- orig:

msg = EmailMultiAlternatives(subject, text_content, from_email, to)

new:

msg = EmailMultiAlternatives(subject, text_content, from_email, [to])

Attachments

5615.diff (0.6 kB) - added by tvrg on 09/27/07 04:56:05.

Change History

09/27/07 04:56:05 changed by tvrg

  • attachment 5615.diff added.

09/27/07 04:56:56 changed by tvrg

  • needs_better_patch changed.
  • has_patch set to 1.
  • needs_tests changed.
  • needs_docs changed.

I prefer the second fix since it is consistent with the next example


msg = EmailMessage?(subject, html_content, from_email, [to]) msg.content_subtype = "html" # Main content is now text/html msg.send()


feel free to disagree

09/27/07 12:23:13 changed by mboersma

  • keywords set to email to.
  • summary changed from typo in e-mail documenation: "to" address is a string, not a list to Typo in email docs: "to" field should be a list.
  • stage changed from Unreviewed to Ready for checkin.

The specific code that this ends up calling is the parent class EmailMessage?.init, which does indeed expect a list as it does ','.join() on it soon afterward. I prefer the second fix as you have in your patch, too.

09/27/07 12:32:30 changed by raprasad@gmail.com

Agreed.

tvrg's patch looks good

09/27/07 22:07:37 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to fixed.

(In [6431]) Fixed #5615: Corrected a typo in docs/email.txt. Thanks, raprasad@gmail.com.

10/03/07 03:05:48 changed by anonymous

cool


Add/Change #5615 (Typo in email docs: "to" field should be a list)




Change Properties
Action