8000 Support nesting TwiML verbs via `with` by dougblack · Pull Request #366 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Support nesting TwiML verbs via with #366

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

Merged
2 commits merged into from
Jul 12, 2017
Merged

Support nesting TwiML verbs via with #366

2 commits merged into from
Jul 12, 2017

Conversation

dougblack
Copy link
Contributor
@dougblack dougblack commented Jun 30, 2017

Usage examples in test cases.

@ilanbiala
Copy link
Contributor

This fixes with blocks, but if someone wants to do something like this:

r = VoiceResponse()
d = Dial(number='1234567890')
d2 = Dial(number='0987654321')
r.append(d).append(d2)

They'll get str(r) returning:

'<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>1234567890<Dial>0987654321</Dial></Dial>
</Response>'

which probably isn't what we want to return. That said, I'm not sure how many people do x.append(y).append(z).

@dougblack
Copy link
Contributor Author

That's a fair point @ilanbiala. I've restored append()'s original semantics and introduced nest() which returns the verb.

@jheld
Copy link
jheld commented Jun 30, 2017

We literally just ran into this issue on our production site. We upgraded the API this week.

Once I realized that the outputted XML looked different than before, I came here to verify if it was an issue. Thank you for helping to validate that. As such, we're going to use the with once it works again.

+1

@ghost ghost merged commit 0eec3b6 into master Jul 12, 2017
@ghost ghost deleted the nesting-verbs branch July 12, 2017 20:24
@ghost ghost restored the nesting-verbs branch July 12, 2017 20:44
@ghost ghost deleted the nesting-verbs branch July 12, 2017 21:43
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0