{"action":"created","issue":{"url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/796","repository_url":"https://api.github.com/repos/hotosm/osm-tasking-manager2","labels_url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/796/labels{/name}","comments_url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/796/comments","events_url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/796/events","html_url":"https://github.com/hotosm/osm-tasking-manager2/pull/796","id":153915655,"number":796,"title":"[WIP] Implement project cloning; fixes #689","user":{"login":"ethan-nelson","id":8998918,"avatar_url":"https://avatars.githubusercontent.com/u/8998918?v=3","gravatar_id":"","url":"https://api.github.com/users/ethan-nelson","html_url":"https://github.com/ethan-nelson","followers_url":"https://api.github.com/users/ethan-nelson/followers","following_url":"https://api.github.com/users/ethan-nelson/following{/other_user}","gists_url":"https://api.github.com/users/ethan-nelson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethan-nelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethan-nelson/subscriptions","organizations_url":"https://api.github.com/users/ethan-nelson/orgs","repos_url":"https://api.github.com/users/ethan-nelson/repos","events_url":"https://api.github.com/users/ethan-nelson/events{/privacy}","received_events_url":"https://api.github.com/users/ethan-nelson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-10T03:16:55Z","updated_at":"2016-05-10T03:51:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/pulls/796","html_url":"https://github.com/hotosm/osm-tasking-manager2/pull/796","diff_url":"https://github.com/hotosm/osm-tasking-manager2/pull/796.diff","patch_url":"https://github.com/hotosm/osm-tasking-manager2/pull/796.patch"},"body":"Brought up in #689 is a requested functionality to clone projects. \r\n\r\nI've implemented this in a somewhat mechanical way. After a user specifies a project to clone on the new project splash screen, the `project_clone` view goes through and copies all of the old attributes, columns, and tasks. The only things unique in the new project attributes are the id number (assigned when the new model is initialized) and possibly the author if the cloner is not the original author.\r\n\r\nOld tasks are used to initialize new tasks with the corresponding project number, as are priority areas and translations.\r\n\r\nWork in progress so I haven't written tests or flake8'd it.\r\n\r\nA few items I'm looking for input on:\r\n\r\n* Lots of if statements...should we condense these attributes into one array and loop over them similar to:\r\n```\r\nattrs = ['entities_to_map','license_id'...]\r\nfor attr in attrs:\r\n    if hasattr(old_project, attr):\r\n        setattr(new_project, getattr(old_project, attr))\r\n````\r\n* Placeholder for other things I will likely think of later"},"comment":{"url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/comments/218052618","html_url":"https://github.com/hotosm/osm-tasking-manager2/pull/796#issuecomment-218052618","issue_url":"https://api.github.com/repos/hotosm/osm-tasking-manager2/issues/796","id":218052618,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T03:51:01Z","updated_at":"2016-05-10T03:51:01Z","body":"\n[![Coverage Status](https://coveralls.io/builds/6112720/badge)](https://coveralls.io/builds/6112720)\n\nCoverage decreased (-2.9%) to 91.935% when pulling **b8e630990e78e66e541f256a3ff8228c20f7f220 on ethan-nelson:clone-project** into **5487acbbf3f9ffaeb25ad745dab4955af3fb2c00 on hotosm:master**.\n"}}