diff options
| author | dobesv <dobesv@gmail.com> | 2014-07-09 15:15:08 -0700 |
|---|---|---|
| committer | dobesv <dobesv@gmail.com> | 2014-07-09 15:15:08 -0700 |
| commit | eae99acbf9eed71967ff12961e495f27708d1f39 (patch) | |
| tree | 58cbd5907d9f6065dab135b6928d5f40bcc4e1a5 /docs/quick_tutorial/forms.rst | |
| parent | 3f87c228c920edbb85a85f3332a5340063e49b11 (diff) | |
| download | pyramid-eae99acbf9eed71967ff12961e495f27708d1f39.tar.gz pyramid-eae99acbf9eed71967ff12961e495f27708d1f39.tar.bz2 pyramid-eae99acbf9eed71967ff12961e495f27708d1f39.zip | |
Allow the last callback called to add a callback
This fixes a bug in the finished and response callbacks where if the last/only callback adds another callback, the newly added callback won't be called afterwards.
This is because when it tries to add the callback, it is added to a new list instance because the callbacks list is empty at that time; the check for whether the callbacks list was created didn't previously distinguish between an empty list and not a list. However, if it is not the last callback in the list, the callbacks list will not be empty and the new callback will be added to the same list and the newly added callback *will* be called.
Because the code as written appears to be trying to support callbacks adding callbacks, this push request modifies the code so that a callback may add another callback whether it is the last one or not.
An alternative approach would be to modify the code so that callbacks cannot add new callbacks, which also would be reasonable. But I think it's a bug that the behavior depends currently on whether you are in the last/only callback when you try to add another one.
Diffstat (limited to 'docs/quick_tutorial/forms.rst')
0 files changed, 0 insertions, 0 deletions
