﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13842	XViewMiddleware fails with django.contrib.syndication.views.Feed	ch0wn	Matthias Kestenholz	"When doing a HEAD request on a class-based view, while having XViewMiddleware enabled, an error occures when accessing {{{view_func.__name__}}}, as an instance does not provide a {{{__name__}}} attribute.

== Example ==

views.py
{{{
#!python

# mapped to /1
def simple_function(request):
    return HttpResponse(""Hello World"")


# mapped to /2
class SimpleClass(object):
    def __call__(self, request):
        return HttpResponse(""Hello World"")
}}}

{{{
» curl -I http://localhost:8000/1
HTTP/1.0 200 OK
Date: Sun, 27 Jun 2010 20:10:25 GMT
Server: WSGIServer/0.1 Python/2.6.5
X-View: djangoheadfix.views.simple_function
Content-Type: text/html; charset=utf-8

» curl -I http://localhost:8000/2
HTTP/1.0 500 INTERNAL SERVER ERROR
Date: Sun, 27 Jun 2010 20:10:56 GMT
Server: WSGIServer/0.1 Python/2.6.5
Content-Type: text/html
}}}

I'm going to attach a patch for this."	Bug	closed	Core (Other)	dev	Normal	fixed	middleware class-based-views	phartig@…	Accepted	0	0	0	0	0	0
