Ticket #6268: ticket6268.patch

File ticket6268.patch, 661 bytes (added by Jan Rademaker <j.rademaker@…>, 7 years ago)

Make sure a view returns a HttpResponse object

  • django/core/handlers/base.py

     
    9091                        return response
    9192                raise
    9293
    93             # Complain if the view returned None (a common error).
    94             if response is None:
     94            # Complain if the view did not return a http.HttpResonse object.
     95            if not isinstance(response, http.HttpResponse):
    9596                try:
    9697                    view_name = callback.func_name # If it's a function
    9798                except AttributeError:
Back to Top