{"action":"closed","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4690","repository_url":"https://api.github.com/repos/tomchristie/django-rest-framework","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4690/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4690/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4690/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/4690","id":190514571,"number":4690,"title":"'type' object is not iterable","user":{"login":"pedrotnascimento","id":11335767,"avatar_url":"https://avatars.githubusercontent.com/u/11335767?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrotnascimento","html_url":"https://github.com/pedrotnascimento","followers_url":"https://api.github.com/users/pedrotnascimento/followers","following_url":"https://api.github.com/users/pedrotnascimento/following{/other_user}","gists_url":"https://api.github.com/users/pedrotnascimento/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrotnascimento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrotnascimento/subscriptions","organizations_url":"https://api.github.com/users/pedrotnascimento/orgs","repos_url":"https://api.github.com/users/pedrotnascimento/repos","events_url":"https://api.github.com/users/pedrotnascimento/events{/privacy}","received_events_url":"https://api.github.com/users/pedrotnascimento/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-19T19:16:24Z","updated_at":"2016-11-19T19:53:15Z","closed_at":"2016-11-19T19:53:15Z","body":"## Checklist\r\n\r\n- [ x] I have verified that that issue exists against the `master` branch of Django REST framework.\r\n- [ x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.\r\n- [ x] This is not a usage question. (Those should be directed to the [discussion group](https://groups.google.com/forum/#!forum/django-rest-framework) instead.)\r\n- [ x] This cannot be dealt with as a third party library. (We prefer new functionality to be [in the form of third party libraries](http://www.django-rest-framework.org/topics/third-party-resources/#about-third-party-packages) where possible.)\r\n- [ x] I have reduced the issue to the simplest possible case.\r\n- [ x] I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)\r\n\r\n## Steps to reproduce\r\nfollowing the django rest tutorial : http://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/#creating-an-endpoint-for-the-highlighted-snippets\r\n\r\nit says to add this, to views.py:\r\n\r\nclass SnippetList(generics.ListCreateAPIView):\r\n    \"\"\"\r\n    List all snippets, or create a new snipet\r\n    \"\"\"\r\n    queryset = Snippet.objects.all()\r\n    serializer_class= SnippetSerializer\r\n    permission_classes = (permissions.IsAuthenticatedOrReadOnly)\r\n\r\n## Expected behavior \r\nWork without error\r\n\r\n## Actual behavior\r\nGive this error in browser(with python 1.8):\r\n\r\nTypeError at /snippets/\r\n'type' object is not iterable\r\nRequest Method:\tGET\r\nRequest URL:\thttp://localhost:8000/snippets/\r\n\r\n## SOLUTION\r\nchange this \r\n    permission_classes = (permissions.IsAuthenticatedOrReadOnly)\r\nfor this:\r\n    permission_classes = (permissions.IsAuthenticatedOrReadOnly,)  # note the comma\r\n\r\n## FURTHER SOLUTION(reason of the oppening issue )\r\n staff check if the behaviour occurs and update the tutorial if so.\r\n"}}
{"actor":{"display_login":"xordoquy"}}