codysoyland/django-phased — pull request #10 by jkuczm (2013-09-14 16:44:40+00:00)
Title: Unpickle context only from `phased` blocks

Function `utils.second_pass_render` tried to unpickle stashed context from all bits of content resulting from splitting of template by `PHASED_SECRET_DELIMITER`.

But only odd bits are results of `phased` block rendering, so only those bits contain stashed context.

Even bits can't contain stashed context and since they are results of first pass rendering they can be arbitrary long and even for content of sane length, searching for regular expression match done in `utils.unpickle_context` function can take insanely long time (which is the source of problems reported in #9).

Fixed by unpickling context only from odd bits.

Fixes: #9