Fixed disable_static_generator decorator

The decorator set the disable_static_generator flag on the view,
but the middleware looked for the flag on the request.

Changed the middleware to prepare on process_view instead of
process_request. Shouldn't interfere with anything else, tests pass.