{"action":"created","comment":{"url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/comments/46473013","id":46473013,"diff_hunk":"@@ -275,6 +228,182 @@ def assign_task(worker_id, task_id):\n     return task\n \n \n+@transaction.atomic\n+def reassign_assignment(worker_id, assignment_id):\n+    worker = Worker.objects.get(id=worker_id)\n+    assignment = TaskAssignment.objects.get(id=assignment_id)\n+    if assignment.assignment_counter > 0:\n+        role = WorkerCertification.Role.REVIEWER\n+    else:\n+        role = WorkerCertification.Role.ENTRY_LEVEL\n+\n+    if not _worker_certified_for_task(worker, assignment.task, role):\n+        raise WorkerCertificationError('Worker not certified for this task.')\n+    if is_worker_assigned_to_task(worker, assignment.task):\n+        raise TaskAssignmentError('Worker already assigned to this task.')\n+\n+    assignment.worker = worker\n+    assignment.save()\n+    add_worker_to_project_team(worker, assignment.task.project)\n+\n+    return assignment\n+\n+\n+@transaction.atomic\n+def complete_and_skip_task(task_id):\n+    task = Task.objects.get(id=task_id)\n+    task.status = Task.Status.COMPLETE\n+    task.save()\n+    for assignment in task.assignments.all():\n+        assignment.status = TaskAssignment.Status.SUBMITTED\n+        assignment.save()\n+    create_subsequent_tasks(task.project)\n+    return task\n+\n+\n+@transaction.atomic\n+def revert_task_to_datetime(task_id, revert_datetime, fake=False):\n+    task = Task.objects.get(id=task_id)\n+    audit = {'task': task, 'change': None, 'assignments': []}\n+\n+    assignments_after = (assignment_history(task)\n+                         .filter(start_datetime__gt=revert_datetime)","path":"orchestra/utils/task_lifecycle.py","position":null,"original_position":151,"commit_id":"f32caf369afd342cb24832ac8050805c6a816adb","original_commit_id":"a9a5fedf1787fbd0d801f8cd3b4a9a4dc9230425","user":{"login":"jrbotros","id":2992765,"avatar_url":"https://avatars.githubusercontent.com/u/2992765?v=3","gravatar_id":"","url":"https://api.github.com/users/jrbotros","html_url":"https://github.com/jrbotros","followers_url":"https://api.github.com/users/jrbotros/followers","following_url":"https://api.github.com/users/jrbotros/following{/other_user}","gists_url":"https://api.github.com/users/jrbotros/gists{/gist_id}","starred_url":"https://api.github.com/users/jrbotros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrbotros/subscriptions","organizations_url":"https://api.github.com/users/jrbotros/orgs","repos_url":"https://api.github.com/users/jrbotros/repos","events_url":"https://api.github.com/users/jrbotros/events{/privacy}","received_events_url":"https://api.github.com/users/jrbotros/received_events","type":"User","site_admin":false},"body":"2) Boundary tests still need to be added","created_at":"2015-12-02T20:49:02Z","updated_at":"2015-12-02T20:49:02Z","html_url":"https://github.com/unlimitedlabs/orchestra/pull/74#discussion_r46473013","pull_request_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/comments/46473013"},"html":{"href":"https://github.com/unlimitedlabs/orchestra/pull/74#discussion_r46473013"},"pull_request":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74","id":51734443,"html_url":"https://github.com/unlimitedlabs/orchestra/pull/74","diff_url":"https://github.com/unlimitedlabs/orchestra/pull/74.diff","patch_url":"https://github.com/unlimitedlabs/orchestra/pull/74.patch","issue_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/74","number":74,"state":"open","locked":false,"title":"Implement view for visualizing and administrating projects","user":{"login":"jrbotros","id":2992765,"avatar_url":"https://avatars.githubusercontent.com/u/2992765?v=3","gravatar_id":"","url":"https://api.github.com/users/jrbotros","html_url":"https://github.com/jrbotros","followers_url":"https://api.github.com/users/jrbotros/followers","following_url":"https://api.github.com/users/jrbotros/following{/other_user}","gists_url":"https://api.github.com/users/jrbotros/gists{/gist_id}","starred_url":"https://api.github.com/users/jrbotros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrbotros/subscriptions","organizations_url":"https://api.github.com/users/jrbotros/orgs","repos_url":"https://api.github.com/users/jrbotros/repos","events_url":"https://api.github.com/users/jrbotros/events{/privacy}","received_events_url":"https://api.github.com/users/jrbotros/received_events","type":"User","site_admin":false},"body":"This view provides a visualization for project data and should allow users to circumvent the project and task admin sites for most all common actions, providing functionality for:\r\n* reverting a task to a previous state\r\n* reassigning any assignment for a given task\r\n* adding a new assignment for `AWAITING_PROCESSING` or `PENDING_REVIEW` tasks\r\n* skipping a task and marking it as complete (e.g., a machine task that hangs and prevents subsequent task creation)\r\n* adding and removing slack users from the project group\r\n* creating subsequent tasks for the project\r\n* viewing data and linking to the Django admin at all levels of granularity\r\n\r\nTo view the project management screen for any project, you'll need to be logged into a user who's been added to a `project_admins` Django group.\r\n","created_at":"2015-11-24T23:47:31Z","updated_at":"2015-12-02T20:49:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4988377fd4ff0677d6f486c4a582e9335ca58d5b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74/commits","review_comments_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74/comments","review_comment_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/74/comments","statuses_url":"https://api.github.com/repos/unlimitedlabs/orchestra/statuses/f32caf369afd342cb24832ac8050805c6a816adb","head":{"label":"unlimitedlabs:project_management","ref":"project_management","sha":"f32caf369afd342cb24832ac8050805c6a816adb","user":{"login":"unlimitedlabs","id":12401025,"avatar_url":"https://avatars.githubusercontent.com/u/12401025?v=3","gravatar_id":"","url":"https://api.github.com/users/unlimitedlabs","html_url":"https://github.com/unlimitedlabs","followers_url":"https://api.github.com/users/unlimitedlabs/followers","following_url":"https://api.github.com/users/unlimitedlabs/following{/other_user}","gists_url":"https://api.github.com/users/unlimitedlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/unlimitedlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unlimitedlabs/subscriptions","organizations_url":"https://api.github.com/users/unlimitedlabs/orgs","repos_url":"https://api.github.com/users/unlimitedlabs/repos","events_url":"https://api.github.com/users/unlimitedlabs/events{/privacy}","received_events_url":"https://api.github.com/users/unlimitedlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":42593972,"name":"orchestra","full_name":"unlimitedlabs/orchestra","owner":{"login":"unlimitedlabs","id":12401025,"avatar_url":"https://avatars.githubusercontent.com/u/12401025?v=3","gravatar_id":"","url":"https://api.github.com/users/unlimitedlabs","html_url":"https://github.com/unlimitedlabs","followers_url":"https://api.github.com/users/unlimitedlabs/followers","following_url":"https://api.github.com/users/unlimitedlabs/following{/other_user}","gists_url":"https://api.github.com/users/unlimitedlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/unlimitedlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unlimitedlabs/subscriptions","organizations_url":"https://api.github.com/users/unlimitedlabs/orgs","repos_url":"https://api.github.com/users/unlimitedlabs/repos","events_url":"https://api.github.com/users/unlimitedlabs/events{/privacy}","received_events_url":"https://api.github.com/users/unlimitedlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unlimitedlabs/orchestra","description":"Orchestra is a system for orchestrating project teams of experts and machines.","fork":false,"url":"https://api.github.com/repos/unlimitedlabs/orchestra","forks_url":"https://api.github.com/repos/unlimitedlabs/orchestra/forks","keys_url":"https://api.github.com/repos/unlimitedlabs/orchestra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unlimitedlabs/orchestra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unlimitedlabs/orchestra/teams","hooks_url":"https://api.github.com/repos/unlimitedlabs/orchestra/hooks","issue_events_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/events{/number}","events_url":"https://api.github.com/repos/unlimitedlabs/orchestra/events","assignees_url":"https://api.github.com/repos/unlimitedlabs/orchestra/assignees{/user}","branches_url":"https://api.github.com/repos/unlimitedlabs/orchestra/branches{/branch}","tags_url":"https://api.github.com/repos/unlimitedlabs/orchestra/tags","blobs_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/refs{/sha}","trees_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unlimitedlabs/orchestra/statuses/{sha}","languages_url":"https://api.github.com/repos/unlimitedlabs/orchestra/languages","stargazers_url":"https://api.github.com/repos/unlimitedlabs/orchestra/stargazers","contributors_url":"https://api.github.com/repos/unlimitedlabs/orchestra/contributors","subscribers_url":"https://api.github.com/repos/unlimitedlabs/orchestra/subscribers","subscription_url":"https://api.github.com/repos/unlimitedlabs/orchestra/subscription","commits_url":"https://api.github.com/repos/unlimitedlabs/orchestra/commits{/sha}","git_commits_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/commits{/sha}","comments_url":"https://api.github.com/repos/unlimitedlabs/orchestra/comments{/number}","issue_comment_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/comments{/number}","contents_url":"https://api.github.com/repos/unlimitedlabs/orchestra/contents/{+path}","compare_url":"https://api.github.com/repos/unlimitedlabs/orchestra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unlimitedlabs/orchestra/merges","archive_url":"https://api.github.com/repos/unlimitedlabs/orchestra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unlimitedlabs/orchestra/downloads","issues_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues{/number}","pulls_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls{/number}","milestones_url":"https://api.github.com/repos/unlimitedlabs/orchestra/milestones{/number}","notifications_url":"https://api.github.com/repos/unlimitedlabs/orchestra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unlimitedlabs/orchestra/labels{/name}","releases_url":"https://api.github.com/repos/unlimitedlabs/orchestra/releases{/id}","created_at":"2015-09-16T14:55:16Z","updated_at":"2015-11-29T04:19:56Z","pushed_at":"2015-12-02T01:13:03Z","git_url":"git://github.com/unlimitedlabs/orchestra.git","ssh_url":"git@github.com:unlimitedlabs/orchestra.git","clone_url":"https://github.com/unlimitedlabs/orchestra.git","svn_url":"https://github.com/unlimitedlabs/orchestra","homepage":"http://orchestra.unlimitedlabs.com/","size":4295,"stargazers_count":207,"watchers_count":207,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":21,"forks":13,"open_issues":21,"watchers":207,"default_branch":"master"}},"base":{"label":"unlimitedlabs:master","ref":"master","sha":"96719faf28de0784dd2b5cffa9e491cf3be5cece","user":{"login":"unlimitedlabs","id":12401025,"avatar_url":"https://avatars.githubusercontent.com/u/12401025?v=3","gravatar_id":"","url":"https://api.github.com/users/unlimitedlabs","html_url":"https://github.com/unlimitedlabs","followers_url":"https://api.github.com/users/unlimitedlabs/followers","following_url":"https://api.github.com/users/unlimitedlabs/following{/other_user}","gists_url":"https://api.github.com/users/unlimitedlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/unlimitedlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unlimitedlabs/subscriptions","organizations_url":"https://api.github.com/users/unlimitedlabs/orgs","repos_url":"https://api.github.com/users/unlimitedlabs/repos","events_url":"https://api.github.com/users/unlimitedlabs/events{/privacy}","received_events_url":"https://api.github.com/users/unlimitedlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":42593972,"name":"orchestra","full_name":"unlimitedlabs/orchestra","owner":{"login":"unlimitedlabs","id":12401025,"avatar_url":"https://avatars.githubusercontent.com/u/12401025?v=3","gravatar_id":"","url":"https://api.github.com/users/unlimitedlabs","html_url":"https://github.com/unlimitedlabs","followers_url":"https://api.github.com/users/unlimitedlabs/followers","following_url":"https://api.github.com/users/unlimitedlabs/following{/other_user}","gists_url":"https://api.github.com/users/unlimitedlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/unlimitedlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unlimitedlabs/subscriptions","organizations_url":"https://api.github.com/users/unlimitedlabs/orgs","repos_url":"https://api.github.com/users/unlimitedlabs/repos","events_url":"https://api.github.com/users/unlimitedlabs/events{/privacy}","received_events_url":"https://api.github.com/users/unlimitedlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unlimitedlabs/orchestra","description":"Orchestra is a system for orchestrating project teams of experts and machines.","fork":false,"url":"https://api.github.com/repos/unlimitedlabs/orchestra","forks_url":"https://api.github.com/repos/unlimitedlabs/orchestra/forks","keys_url":"https://api.github.com/repos/unlimitedlabs/orchestra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unlimitedlabs/orchestra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unlimitedlabs/orchestra/teams","hooks_url":"https://api.github.com/repos/unlimitedlabs/orchestra/hooks","issue_events_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/events{/number}","events_url":"https://api.github.com/repos/unlimitedlabs/orchestra/events","assignees_url":"https://api.github.com/repos/unlimitedlabs/orchestra/assignees{/user}","branches_url":"https://api.github.com/repos/unlimitedlabs/orchestra/branches{/branch}","tags_url":"https://api.github.com/repos/unlimitedlabs/orchestra/tags","blobs_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/refs{/sha}","trees_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unlimitedlabs/orchestra/statuses/{sha}","languages_url":"https://api.github.com/repos/unlimitedlabs/orchestra/languages","stargazers_url":"https://api.github.com/repos/unlimitedlabs/orchestra/stargazers","contributors_url":"https://api.github.com/repos/unlimitedlabs/orchestra/contributors","subscribers_url":"https://api.github.com/repos/unlimitedlabs/orchestra/subscribers","subscription_url":"https://api.github.com/repos/unlimitedlabs/orchestra/subscription","commits_url":"https://api.github.com/repos/unlimitedlabs/orchestra/commits{/sha}","git_commits_url":"https://api.github.com/repos/unlimitedlabs/orchestra/git/commits{/sha}","comments_url":"https://api.github.com/repos/unlimitedlabs/orchestra/comments{/number}","issue_comment_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/comments{/number}","contents_url":"https://api.github.com/repos/unlimitedlabs/orchestra/contents/{+path}","compare_url":"https://api.github.com/repos/unlimitedlabs/orchestra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unlimitedlabs/orchestra/merges","archive_url":"https://api.github.com/repos/unlimitedlabs/orchestra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unlimitedlabs/orchestra/downloads","issues_url":"https://api.github.com/repos/unlimitedlabs/orchestra/issues{/number}","pulls_url":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls{/number}","milestones_url":"https://api.github.com/repos/unlimitedlabs/orchestra/milestones{/number}","notifications_url":"https://api.github.com/repos/unlimitedlabs/orchestra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unlimitedlabs/orchestra/labels{/name}","releases_url":"https://api.github.com/repos/unlimitedlabs/orchestra/releases{/id}","created_at":"2015-09-16T14:55:16Z","updated_at":"2015-11-29T04:19:56Z","pushed_at":"2015-12-02T01:13:03Z","git_url":"git://github.com/unlimitedlabs/orchestra.git","ssh_url":"git@github.com:unlimitedlabs/orchestra.git","clone_url":"https://github.com/unlimitedlabs/orchestra.git","svn_url":"https://github.com/unlimitedlabs/orchestra","homepage":"http://orchestra.unlimitedlabs.com/","size":4295,"stargazers_count":207,"watchers_count":207,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":21,"forks":13,"open_issues":21,"watchers":207,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74"},"html":{"href":"https://github.com/unlimitedlabs/orchestra/pull/74"},"issue":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/74"},"comments":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/unlimitedlabs/orchestra/statuses/f32caf369afd342cb24832ac8050805c6a816adb"}}}}