{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3207","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3207/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3207/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3207/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3207","id":98489101,"number":3207,"title":"ContentType matching query does not exist cause when UserViewSet uses DjangoObjectPermissionsFilter","user":{"login":"mcastle","id":3880707,"avatar_url":"https://avatars.githubusercontent.com/u/3880707?v=3","gravatar_id":"","url":"https://api.github.com/users/mcastle","html_url":"https://github.com/mcastle","followers_url":"https://api.github.com/users/mcastle/followers","following_url":"https://api.github.com/users/mcastle/following{/other_user}","gists_url":"https://api.github.com/users/mcastle/gists{/gist_id}","starred_url":"https://api.github.com/users/mcastle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcastle/subscriptions","organizations_url":"https://api.github.com/users/mcastle/orgs","repos_url":"https://api.github.com/users/mcastle/repos","events_url":"https://api.github.com/users/mcastle/events{/privacy}","received_events_url":"https://api.github.com/users/mcastle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-31T23:38:23Z","updated_at":"2015-08-01T06:43:20Z","closed_at":null,"body":"I have the following UserViewSet:\r\n\r\n```\r\nclass UserViewSet(viewsets.ReadOnlyModelViewSet):\r\n    queryset = User.objects.all()\r\n    serializer_class = UserSerializer\r\n    permission_classes = (CustomObjectPermissions,)\r\n    filter_backends = (filters.DjangoObjectPermissionsFilter,)\r\n```\r\nWhen using the api browser to view the User list or a User, I get the error `DoesNotExist` ... `ContentType matching query does not exist.`\r\n\r\nThis error does not occur for other viewsets. It appears to be an issue with the django-guardian shortcut `get_objects_for_user()`. I've read of similar issues and it seems it relates to django-rest passing the permission as unicode (in this case, `u'view_user'`).\r\n"},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/126873639","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3207#issuecomment-126873639","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3207","id":126873639,"user":{"login":"tomchristie","id":647359,"avatar_url":"https://avatars.githubusercontent.com/u/647359?v=3","gravatar_id":"","url":"https://api.github.com/users/tomchristie","html_url":"https://github.com/tomchristie","followers_url":"https://api.github.com/users/tomchristie/followers","following_url":"https://api.github.com/users/tomchristie/following{/other_user}","gists_url":"https://api.github.com/users/tomchristie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomchristie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomchristie/subscriptions","organizations_url":"https://api.github.com/users/tomchristie/orgs","repos_url":"https://api.github.com/users/tomchristie/repos","events_url":"https://api.github.com/users/tomchristie/events{/privacy}","received_events_url":"https://api.github.com/users/tomchristie/received_events","type":"User","site_admin":false},"created_at":"2015-08-01T06:43:20Z","updated_at":"2015-08-01T06:43:20Z","body":"What versions of guardian and rest framework? If you subclass the filter and ensure that it passes binary/str values instead does that resolve the issue? Can you trivially reproduce this in a new project?"}}