{"action":"opened","issue":{"url":"https://api.github.com/repos/jazzband/django-debug-toolbar/issues/874","repository_url":"https://api.github.com/repos/jazzband/django-debug-toolbar","labels_url":"https://api.github.com/repos/jazzband/django-debug-toolbar/issues/874/labels{/name}","comments_url":"https://api.github.com/repos/jazzband/django-debug-toolbar/issues/874/comments","events_url":"https://api.github.com/repos/jazzband/django-debug-toolbar/issues/874/events","html_url":"https://github.com/jazzband/django-debug-toolbar/issues/874","id":174013454,"number":874,"title":"check_middleware does not work with function in MIDDLEWARE","user":{"login":"pm13","id":6249977,"avatar_url":"https://avatars.githubusercontent.com/u/6249977?v=3","gravatar_id":"","url":"https://api.github.com/users/pm13","html_url":"https://github.com/pm13","followers_url":"https://api.github.com/users/pm13/followers","following_url":"https://api.github.com/users/pm13/following{/other_user}","gists_url":"https://api.github.com/users/pm13/gists{/gist_id}","starred_url":"https://api.github.com/users/pm13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pm13/subscriptions","organizations_url":"https://api.github.com/users/pm13/orgs","repos_url":"https://api.github.com/users/pm13/repos","events_url":"https://api.github.com/users/pm13/events{/privacy}","received_events_url":"https://api.github.com/users/pm13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-30T13:04:33Z","updated_at":"2016-08-30T13:04:33Z","closed_at":null,"body":"With Django 1.10 MIDDLEWARE can contain functions (first example in https://docs.djangoproject.com/en/1.10/topics/http/middleware/#writing-your-own-middleware). But function is_middleware_class called by check_middleware (https://github.com/jazzband/django-debug-toolbar/blob/master/debug_toolbar/apps.py#L66) expects that middleware is class.\r\n\r\nPossible change - current code:\r\nreturn issubclass(middleware_cls, middleware_class)\r\n\r\nworking code:\r\nreturn isinstance(middleware_cls, type) and issubclass(middleware_cls, middleware_class)"}}
{"actor":{"display_login":"pm13"}}