{"action":"created","issue":{"url":"https://api.github.com/repos/c2corg/v6_forum/issues/22","repository_url":"https://api.github.com/repos/c2corg/v6_forum","labels_url":"https://api.github.com/repos/c2corg/v6_forum/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/c2corg/v6_forum/issues/22/comments","events_url":"https://api.github.com/repos/c2corg/v6_forum/issues/22/events","html_url":"https://github.com/c2corg/v6_forum/issues/22","id":146048344,"number":22,"title":"Duplicated usernames and login_names in v5","user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars.githubusercontent.com/u/7294662?v=3","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"labels":[{"id":478418905,"url":"https://api.github.com/repos/c2corg/v6_forum/labels/blocking","name":"blocking","color":"b60205","default":false},{"id":397276684,"url":"https://api.github.com/repos/c2corg/v6_forum/labels/Migration%20V5-V6","name":"Migration V5-V6","color":"d93f0b","default":false},{"id":357458567,"url":"https://api.github.com/repos/c2corg/v6_forum/labels/waiting%20for%20instructions","name":"waiting for instructions","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":30,"created_at":"2016-04-05T16:59:11Z","updated_at":"2016-11-16T15:38:01Z","closed_at":null,"body":"The username and login_name fields are not unique in v5 as can be shown by the following 2 requests:\n\n``` sql\nselect id, username from app_users_private_data where username in (select username from app_users_private_data group by username having count(username) >= 2) order by username;\n```\n\n-> 42 results\n\n``` sql\nselect id, login_name from app_users_private_data where login_name in (select login_name from app_users_private_data group by login_name having count(*) >= 2) order by login_name;\n```\n\n-> 48 results\n\nIt is essential that the v5 database be fixed so that we can import in the topoguide and in Discourse\nrobustly and consistently.@fbunoz, could you please have a look to this?\n- [ ]  the fields should be made unique (maybe by suffixing older accounts);\n- [ ] unique constraints should be added to the user table.\n\nIn addition, due to [restrictions in the Discourse forum usernames](https://meta.discourse.org/t/what-are-the-rules-for-usernames/13458), we cannot use the `username` field (forum name) as-is. The problem is that normalizing the username may result in non-unique usernames. @fbunoz, would it be possible to include a normalized and unique column in the dumps? In addition, a few weeks before the final migration could users be prevented to change their forum pseudo?\n- [ ] add a `discourse_username` column to v5 dump with a normalized and unique pseudo name;\n- [ ] block forum pseudo change in Discourse a few weeks before the final migration.\n"},"comment":{"url":"https://api.github.com/repos/c2corg/v6_forum/issues/comments/260977806","html_url":"https://github.com/c2corg/v6_forum/issues/22#issuecomment-260977806","issue_url":"https://api.github.com/repos/c2corg/v6_forum/issues/22","id":260977806,"user":{"login":"asaunier","id":1192331,"avatar_url":"https://avatars.githubusercontent.com/u/1192331?v=3","gravatar_id":"","url":"https://api.github.com/users/asaunier","html_url":"https://github.com/asaunier","followers_url":"https://api.github.com/users/asaunier/followers","following_url":"https://api.github.com/users/asaunier/following{/other_user}","gists_url":"https://api.github.com/users/asaunier/gists{/gist_id}","starred_url":"https://api.github.com/users/asaunier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asaunier/subscriptions","organizations_url":"https://api.github.com/users/asaunier/orgs","repos_url":"https://api.github.com/users/asaunier/repos","events_url":"https://api.github.com/users/asaunier/events{/privacy}","received_events_url":"https://api.github.com/users/asaunier/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T15:38:01Z","updated_at":"2016-11-16T15:38:01Z","body":"Le formulaire \"account\" contient lui-même une validation cohérente avec celle du script de normalisation v5 : https://github.com/c2corg/v6_ui/blob/master/c2corg_ui/templates/account.html#L38\r\n\r\nPareil pour la base de données de l'API (qui fait foi) : \r\nhttps://github.com/c2corg/v6_api/blob/master/c2corg_api/models/user.py#L78-L81\r\n\r\nSi le script de normalisation est modifié il faudra aussi modifier ces validations. Idem si plus tard les règles sur les pseudos sont modifiées.\r\n\r\n\"lutindelaforet\" je trouve ca bien plus cool comme pseudo que \"lutin.de.la.foret\".\r\n\r\n"}}
{"actor":{"display_login":"asaunier"}}