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

Already on GitHub? Sign in to your account

Fix for issue #20034; allow callback for variables successfully parsed in multipart POST upload. #898

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Modified upload handler API to be able to invoke callbacks when new fields/variables are successfully parsed from multipart POST request. Fix for #20034.

@naftulikay naftulikay Modified upload handler API to be able to invoke callbacks when new f…
…ields/variables

are successfully parsed from multipart POST request. Fix for #20034.
ffa2d2e

@tadeck tadeck commented on the diff May 18, 2013

django/http/multipartparser.py
@@ -167,6 +167,13 @@ def parse(self):
self._post.appendlist(field_name,
force_text(data, encoding, errors='replace'))
+
+ for handler in handlers:
+ try :
+ handler.variable_complete(field_name, force_text(data, encoding, errors='replace'))
@tadeck

tadeck May 18, 2013

Contributor

Maybe you should make it more DRY (by reusing force_text(data, encoding, errors='replace')). Later someone may actually forget to change it in two places. Or you think handler.variable_complete and self._post.appendlist should stay as you proposed?

Contributor

tadeck commented May 18, 2013

It needs tests.

Owner

timgraham commented May 31, 2013

Superseded by #1148

@timgraham timgraham closed this May 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment