{"action":"created","issue":{"url":"https://api.github.com/repos/inveniosoftware/invenio/issues/3169","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/3169/labels{/name}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/3169/comments","events_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/3169/events","html_url":"https://github.com/inveniosoftware/invenio/issues/3169","id":81939960,"number":3169,"title":"accounts: send email validation when a User is inserted","user":{"login":"nharraud","id":5708796,"avatar_url":"https://avatars.githubusercontent.com/u/5708796?v=3","gravatar_id":"","url":"https://api.github.com/users/nharraud","html_url":"https://github.com/nharraud","followers_url":"https://api.github.com/users/nharraud/followers","following_url":"https://api.github.com/users/nharraud/following{/other_user}","gists_url":"https://api.github.com/users/nharraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nharraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nharraud/subscriptions","organizations_url":"https://api.github.com/users/nharraud/orgs","repos_url":"https://api.github.com/users/nharraud/repos","events_url":"https://api.github.com/users/nharraud/events{/privacy}","received_events_url":"https://api.github.com/users/nharraud/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/inveniosoftware/invenio/labels/t_enhancement","name":"t_enhancement","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/6","html_url":"https://github.com/inveniosoftware/invenio/milestones/v2.2.0","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/6/labels","id":696686,"number":6,"title":"v2.2.0","description":"Invenio v2.2 will use new data model and fully run on PostgreSQL.","creator":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"open_issues":177,"closed_issues":69,"state":"open","created_at":"2014-06-20T11:43:39Z","updated_at":"2015-07-07T09:08:25Z","due_on":"2015-07-30T22:00:00Z","closed_at":null},"comments":1,"created_at":"2015-05-28T14:01:46Z","updated_at":"2015-07-08T13:40:53Z","closed_at":null,"body":"It would be cleaner to send the validation email when a new `User` is inserted in the database, using SQLAlchemy `after_insert` event. However sending the validation email modifies the database, which is not permitted in `after_insert` handlers.\r\nAn attempt at this can be found here: nharraud/invenio@1ada2fa1a0ef6d569b1d7c9621ea479d707a59b9\r\nI tried to send the email using celery to avoid modifying the database in the trigger. However this is not possible as celery tasks run in the main process during tests."},"comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio/issues/comments/119582399","html_url":"https://github.com/inveniosoftware/invenio/issues/3169#issuecomment-119582399","issue_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/3169","id":119582399,"user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T13:40:53Z","updated_at":"2015-07-08T13:40:53Z","body":"I recently rewrote the \"lost password\" behavior #3326 (I hope it'll be integrated soon in master). \r\nIt send an \"confirmation\" email with the link for change password.\r\nMaybe you can use the same method."}}