{"action":"created","issue":{"url":"https://api.github.com/repos/pennersr/django-allauth/issues/1420","repository_url":"https://api.github.com/repos/pennersr/django-allauth","labels_url":"https://api.github.com/repos/pennersr/django-allauth/issues/1420/labels{/name}","comments_url":"https://api.github.com/repos/pennersr/django-allauth/issues/1420/comments","events_url":"https://api.github.com/repos/pennersr/django-allauth/issues/1420/events","html_url":"https://github.com/pennersr/django-allauth/pull/1420","id":162782193,"number":1420,"title":"battlenet: Only set the battletag as username if available","user":{"login":"jleclanche","id":235410,"avatar_url":"https://avatars.githubusercontent.com/u/235410?v=3","gravatar_id":"","url":"https://api.github.com/users/jleclanche","html_url":"https://github.com/jleclanche","followers_url":"https://api.github.com/users/jleclanche/followers","following_url":"https://api.github.com/users/jleclanche/following{/other_user}","gists_url":"https://api.github.com/users/jleclanche/gists{/gist_id}","starred_url":"https://api.github.com/users/jleclanche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleclanche/subscriptions","organizations_url":"https://api.github.com/users/jleclanche/orgs","repos_url":"https://api.github.com/users/jleclanche/repos","events_url":"https://api.github.com/users/jleclanche/events{/privacy}","received_events_url":"https://api.github.com/users/jleclanche/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pennersr/django-allauth/labels/Incomplete","name":"Incomplete","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-28T20:41:39Z","updated_at":"2016-07-09T11:09:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pennersr/django-allauth/pulls/1420","html_url":"https://github.com/pennersr/django-allauth/pull/1420","diff_url":"https://github.com/pennersr/django-allauth/pull/1420.diff","patch_url":"https://github.com/pennersr/django-allauth/pull/1420.patch"},"body":"References #1380"},"comment":{"url":"https://api.github.com/repos/pennersr/django-allauth/issues/comments/231529054","html_url":"https://github.com/pennersr/django-allauth/pull/1420#issuecomment-231529054","issue_url":"https://api.github.com/repos/pennersr/django-allauth/issues/1420","id":231529054,"user":{"login":"jleclanche","id":235410,"avatar_url":"https://avatars.githubusercontent.com/u/235410?v=3","gravatar_id":"","url":"https://api.github.com/users/jleclanche","html_url":"https://github.com/jleclanche","followers_url":"https://api.github.com/users/jleclanche/followers","following_url":"https://api.github.com/users/jleclanche/following{/other_user}","gists_url":"https://api.github.com/users/jleclanche/gists{/gist_id}","starred_url":"https://api.github.com/users/jleclanche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleclanche/subscriptions","organizations_url":"https://api.github.com/users/jleclanche/orgs","repos_url":"https://api.github.com/users/jleclanche/repos","events_url":"https://api.github.com/users/jleclanche/events{/privacy}","received_events_url":"https://api.github.com/users/jleclanche/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T11:09:43Z","updated_at":"2016-07-09T11:09:43Z","body":"@pennersr Two additional things to keep in mind:\r\n\r\n* \"Battletags\" of the format \"username#number\" are starting to get common. For example, Discord uses them and they also have [an oauth2 API](https://discordapp.com/developers/docs/topics/oauth2). So when discord support is implemented, it will face those same issues.\r\n* The *only* information we get from the battlenet API is the Battletag. Email or any kind of name is not available. So in the case the battletag is null, the fallback right now will be `user`, `user2`, `user3` etc. Very unfriendly, *but* the case where the battletag is null should be exceedingly rare.\r\n\r\nMy recommendation at this point would be to allow the `#` character in the default username regex. I've been using [allauth-battlenet](https://github.com/hearthsim/allauth-battlenet) in [production](https://hsreplay.net/) for the past few weeks and the current version of the code, which is what I PR'd here, works wonderfully well and there's no issue I could find associated with `#` in usernames with allauth other than the regex.\r\n\r\nOverriding `clean_username()` as you suggested would require shipping a custom adapter. I can certainly do it in my own project, but the issue we're facing here is one faced by *all* battlenet allauth users. If you want to switch to `extract_common_fields`, it's not an option. \r\n\r\nI'm not sure what other mechanism you could put in place to fit this use case, I'm not familiar enough with the allauth codebase."}}
{"actor":{"display_login":"jleclanche"}}