{"action":"created","issue":{"url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/62","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/62/comments","events_url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/62/events","html_url":"https://github.com/bugsnag/bugsnag-python/issues/62","id":96657458,"number":62,"title":"User not set correctly when using custom auth in django","user":{"login":"justmobilize","id":1547881,"avatar_url":"https://avatars.githubusercontent.com/u/1547881?v=3","gravatar_id":"","url":"https://api.github.com/users/justmobilize","html_url":"https://github.com/justmobilize","followers_url":"https://api.github.com/users/justmobilize/followers","following_url":"https://api.github.com/users/justmobilize/following{/other_user}","gists_url":"https://api.github.com/users/justmobilize/gists{/gist_id}","starred_url":"https://api.github.com/users/justmobilize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justmobilize/subscriptions","organizations_url":"https://api.github.com/users/justmobilize/orgs","repos_url":"https://api.github.com/users/justmobilize/repos","events_url":"https://api.github.com/users/justmobilize/events{/privacy}","received_events_url":"https://api.github.com/users/justmobilize/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-22T20:33:02Z","updated_at":"2015-09-16T10:35:53Z","closed_at":null,"body":"In the line:\r\n\r\n```\r\nnotification.set_user(id=request.user.username, email=request.user.email, name=name)\r\n```\r\n\r\nIt assumes that the username field is username. In custom authentication this isn't guaranteed to exist. You should do:\r\n\r\n```\r\nnotification.set_user(id=request.user.get_username(), email=request.user.email, name=name)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/comments/140700914","html_url":"https://github.com/bugsnag/bugsnag-python/issues/62#issuecomment-140700914","issue_url":"https://api.github.com/repos/bugsnag/bugsnag-python/issues/62","id":140700914,"user":{"login":"martinse","id":1744832,"avatar_url":"https://avatars.githubusercontent.com/u/1744832?v=3","gravatar_id":"","url":"https://api.github.com/users/martinse","html_url":"https://github.com/martinse","followers_url":"https://api.github.com/users/martinse/followers","following_url":"https://api.github.com/users/martinse/following{/other_user}","gists_url":"https://api.github.com/users/martinse/gists{/gist_id}","starred_url":"https://api.github.com/users/martinse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinse/subscriptions","organizations_url":"https://api.github.com/users/martinse/orgs","repos_url":"https://api.github.com/users/martinse/repos","events_url":"https://api.github.com/users/martinse/events{/privacy}","received_events_url":"https://api.github.com/users/martinse/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T10:35:53Z","updated_at":"2015-09-16T10:35:53Z","body":"Also the name of the user assumes that the fields `first_name` and `last_name` exists which are marked as optional in the User module. Better would be to use `get_full_name()` which is present both in `User` and `CustomUser`.\r\n\r\nhttps://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.models.CustomUser.get_full_name"}}