Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote names containing comma or semicolon #618

Merged
merged 4 commits into from
Oct 5, 2018

Conversation

cmccandless
Copy link
Contributor

@cmccandless cmccandless commented Oct 1, 2018

Fixes #578

Checklist

  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

  • Escapes common CSV delimiters in Email.name

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 1, 2018
@codecov
Copy link

codecov bot commented Oct 1, 2018

Codecov Report

Merging #618 into v4 will increase coverage by 0.03%.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v4     #618      +/-   ##
==========================================
+ Coverage   84.34%   84.38%   +0.03%     
==========================================
  Files          37       37              
  Lines         952      967      +15     
  Branches      105      108       +3     
==========================================
+ Hits          803      816      +13     
- Misses         92       93       +1     
- Partials       57       58       +1
Impacted Files Coverage Δ
sendgrid/helpers/mail/email.py 94.23% <86.66%> (-3.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56a0ad0...32183b7. Read the comment docs.

@thinkingserious thinkingserious added hacktoberfest difficulty: medium fix is medium in difficulty type: twilio enhancement feature request on Twilio's roadmap status: ready for deploy code ready to be released in next deploy status: waiting for feedback waiting for feedback from the submitter and removed status: code review request requesting a community code review or review from Twilio status: ready for deploy code ready to be released in next deploy labels Oct 2, 2018
@thinkingserious
Copy link
Contributor

@cmccandless,

Could you please merge this agains this branch? Thanks!

With Best Regards,

Elmer

@cmccandless cmccandless changed the base branch from master to v4 October 3, 2018 12:22
@cmccandless cmccandless force-pushed the issue-578 branch 3 times, most recently from b580df6 to 0434738 Compare October 3, 2018 13:23
@cmccandless
Copy link
Contributor Author

There... finished the fight with the CI. This PR is ready to merge into v4.

@thinkingserious
Copy link
Contributor

Hello @cmccandless,

Thanks again for the PR!

It's HACKTOBERFEST! We want to show our appreciation by sending you some special Hacktoberfest swag. If you have not already, could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@thinkingserious thinkingserious added status: ready for deploy code ready to be released in next deploy and removed status: waiting for feedback waiting for feedback from the submitter labels Oct 5, 2018
@thinkingserious thinkingserious merged commit 6326325 into sendgrid:v4 Oct 5, 2018
@cmccandless cmccandless deleted the issue-578 branch October 5, 2018 12:57
Copy link

@medmunds medmunds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I realize this was merged a while back, but there are a couple of likely problems in it.)

# Escape common CSV delimiters as workaround for
# https://github.com/sendgrid/sendgrid-python/issues/578
if value is not None and (',' in value or ';' in value):
value = html_entity_decode(value)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you actually want email.utils.quote here. (Email display names don't really have anything to do with HTML entities.)


# Escape common CSV delimiters as workaround for
# https://github.com/sendgrid/sendgrid-python/issues/578
if value is not None and (',' in value or ';' in value):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also or '"' in value. (" in the name will cause the same problems as comma.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants