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

Impossible to use dict as a custom arg #1008

Open
nakeeon opened this issue Sep 10, 2021 · 1 comment
Open

Impossible to use dict as a custom arg #1008

nakeeon opened this issue Sep 10, 2021 · 1 comment
Labels
status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap

Comments

@nakeeon
Copy link

nakeeon commented Sep 10, 2021

Issue Summary

It is impossible to use dict as a custom arg.

Steps to Reproduce

  1. Create Main instance
  2. Call add_custom_arg method or custom_arg setter to set a custom arg. For example: {'test': 'true'}
  3. When run the app, the add_custom_arg will raise an AttributeError.

Code Snippet

mail = Mail()
mail.add_custom_arg({'test': 'true'})

Exception/Log

Traceback (most recent call last):
   ...
    File "/app/sendgrid/helpers/mail/mail.py", line 561, in custom_arg
    self.add_custom_arg(custom_arg)
    File "/app/sendgrid/helpers/mail/mail.py", line 569, in add_custom_arg
    if custom_arg.personalization is not None:
AttributeError: 'dict' object has no attribute 'personalization'

Technical details:

  • sendgrid-python version: 6.8.0
  • python version: 3.8
@shwetha-manvinkurke shwetha-manvinkurke added status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap labels Sep 20, 2021
@JenniferMah
Copy link
Contributor

Hi @nakeeon thanks for submitting a pull request for this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants