{"action":"created","comment":{"url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments/94836177","pull_request_review_id":15373813,"id":94836177,"diff_hunk":"@@ -189,3 +189,27 @@ def create_challenge_host_team(request):\n         challenge_host.save()\n         return Response(response_data, status=status.HTTP_201_CREATED)\n     return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)\n+\n+\n+@throttle_classes([UserRateThrottle, ])\n+@api_view(['DELETE', ])\n+@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))\n+@authentication_classes((ExpiringTokenAuthentication, ))\n+def delete_challenge_host_from_team_by_self(request, challenge_host_team_pk):\n+    \"\"\"\n+    A user can remove himself from the challenge host team.\n+    \"\"\"\n+    try:\n+        challenge_host = ChallengeHostTeam.objects.get(pk=challenge_host_team_pk)\n+    except ChallengeHostTeam.DoesNotExist:\n+        response_data = {'error': 'ChallengeHostTeam does not exist'}\n+        return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)\n+\n+    challenge_host = ChallengeHost.objects.get(user=request.user.id)\n+    if challenge_host.team_name.id == int(challenge_host_team_pk):","path":"apps/hosts/views.py","position":21,"original_position":21,"commit_id":"7df920735dd54e42883c0314f7648acfbb62216e","original_commit_id":"7df920735dd54e42883c0314f7648acfbb62216e","user":{"login":"TroJan","id":4302268,"avatar_url":"https://avatars.githubusercontent.com/u/4302268?v=3","gravatar_id":"","url":"https://api.github.com/users/TroJan","html_url":"https://github.com/TroJan","followers_url":"https://api.github.com/users/TroJan/followers","following_url":"https://api.github.com/users/TroJan/following{/other_user}","gists_url":"https://api.github.com/users/TroJan/gists{/gist_id}","starred_url":"https://api.github.com/users/TroJan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TroJan/subscriptions","organizations_url":"https://api.github.com/users/TroJan/orgs","repos_url":"https://api.github.com/users/TroJan/repos","events_url":"https://api.github.com/users/TroJan/events{/privacy}","received_events_url":"https://api.github.com/users/TroJan/received_events","type":"User","site_admin":false},"body":"I guess that if you update the queryset, you will also realize that there is actually no need of this if condition over here. You can simply delete the queryset.","created_at":"2017-01-05T19:38:17Z","updated_at":"2017-01-05T19:41:25Z","html_url":"https://github.com/Cloud-CV/EvalAI/pull/343#discussion_r94836177","pull_request_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343","_links":{"self":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments/94836177"},"html":{"href":"https://github.com/Cloud-CV/EvalAI/pull/343#discussion_r94836177"},"pull_request":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343"}}},"pull_request":{"url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343","id":100281286,"html_url":"https://github.com/Cloud-CV/EvalAI/pull/343","diff_url":"https://github.com/Cloud-CV/EvalAI/pull/343.diff","patch_url":"https://github.com/Cloud-CV/EvalAI/pull/343.patch","issue_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/343","number":343,"state":"open","locked":false,"title":"API endpoint for deleting a User from a Host Team.","user":{"login":"RishabhJain2018","id":12206047,"avatar_url":"https://avatars.githubusercontent.com/u/12206047?v=3","gravatar_id":"","url":"https://api.github.com/users/RishabhJain2018","html_url":"https://github.com/RishabhJain2018","followers_url":"https://api.github.com/users/RishabhJain2018/followers","following_url":"https://api.github.com/users/RishabhJain2018/following{/other_user}","gists_url":"https://api.github.com/users/RishabhJain2018/gists{/gist_id}","starred_url":"https://api.github.com/users/RishabhJain2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RishabhJain2018/subscriptions","organizations_url":"https://api.github.com/users/RishabhJain2018/orgs","repos_url":"https://api.github.com/users/RishabhJain2018/repos","events_url":"https://api.github.com/users/RishabhJain2018/events{/privacy}","received_events_url":"https://api.github.com/users/RishabhJain2018/received_events","type":"User","site_admin":false},"body":"#338 solved. @deshraj Please review the PR.","created_at":"2017-01-05T12:21:22Z","updated_at":"2017-01-05T19:41:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b86b22057638d8caf4b60fe550cd4c36e3931be","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343/commits","review_comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343/comments","review_comment_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/343/comments","statuses_url":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/7df920735dd54e42883c0314f7648acfbb62216e","head":{"label":"RishabhJain2018:rishabh","ref":"rishabh","sha":"7df920735dd54e42883c0314f7648acfbb62216e","user":{"login":"RishabhJain2018","id":12206047,"avatar_url":"https://avatars.githubusercontent.com/u/12206047?v=3","gravatar_id":"","url":"https://api.github.com/users/RishabhJain2018","html_url":"https://github.com/RishabhJain2018","followers_url":"https://api.github.com/users/RishabhJain2018/followers","following_url":"https://api.github.com/users/RishabhJain2018/following{/other_user}","gists_url":"https://api.github.com/users/RishabhJain2018/gists{/gist_id}","starred_url":"https://api.github.com/users/RishabhJain2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RishabhJain2018/subscriptions","organizations_url":"https://api.github.com/users/RishabhJain2018/orgs","repos_url":"https://api.github.com/users/RishabhJain2018/repos","events_url":"https://api.github.com/users/RishabhJain2018/events{/privacy}","received_events_url":"https://api.github.com/users/RishabhJain2018/received_events","type":"User","site_admin":false},"repo":{"id":73307052,"name":"EvalAI","full_name":"RishabhJain2018/EvalAI","owner":{"login":"RishabhJain2018","id":12206047,"avatar_url":"https://avatars.githubusercontent.com/u/12206047?v=3","gravatar_id":"","url":"https://api.github.com/users/RishabhJain2018","html_url":"https://github.com/RishabhJain2018","followers_url":"https://api.github.com/users/RishabhJain2018/followers","following_url":"https://api.github.com/users/RishabhJain2018/following{/other_user}","gists_url":"https://api.github.com/users/RishabhJain2018/gists{/gist_id}","starred_url":"https://api.github.com/users/RishabhJain2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RishabhJain2018/subscriptions","organizations_url":"https://api.github.com/users/RishabhJain2018/orgs","repos_url":"https://api.github.com/users/RishabhJain2018/repos","events_url":"https://api.github.com/users/RishabhJain2018/events{/privacy}","received_events_url":"https://api.github.com/users/RishabhJain2018/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RishabhJain2018/EvalAI","description":"EvalAI: A platform for hosting AI Challenges","fork":true,"url":"https://api.github.com/repos/RishabhJain2018/EvalAI","forks_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/forks","keys_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/teams","hooks_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/hooks","issue_events_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/issues/events{/number}","events_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/events","assignees_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/assignees{/user}","branches_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/branches{/branch}","tags_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/tags","blobs_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/statuses/{sha}","languages_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/languages","stargazers_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/stargazers","contributors_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/contributors","subscribers_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/subscribers","subscription_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/subscription","commits_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/contents/{+path}","compare_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/merges","archive_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/downloads","issues_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/issues{/number}","pulls_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/pulls{/number}","milestones_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/milestones{/number}","notifications_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/labels{/name}","releases_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/releases{/id}","deployments_url":"https://api.github.com/repos/RishabhJain2018/EvalAI/deployments","created_at":"2016-11-09T17:46:32Z","updated_at":"2016-11-09T17:46:34Z","pushed_at":"2017-01-05T18:51:01Z","git_url":"git://github.com/RishabhJain2018/EvalAI.git","ssh_url":"git@github.com:RishabhJain2018/EvalAI.git","clone_url":"https://github.com/RishabhJain2018/EvalAI.git","svn_url":"https://github.com/RishabhJain2018/EvalAI","homepage":null,"size":1925,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Cloud-CV:master","ref":"master","sha":"96f8b127e671d0e0620f13a544ae36714719d382","user":{"login":"Cloud-CV","id":20895851,"avatar_url":"https://avatars.githubusercontent.com/u/20895851?v=3","gravatar_id":"","url":"https://api.github.com/users/Cloud-CV","html_url":"https://github.com/Cloud-CV","followers_url":"https://api.github.com/users/Cloud-CV/followers","following_url":"https://api.github.com/users/Cloud-CV/following{/other_user}","gists_url":"https://api.github.com/users/Cloud-CV/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloud-CV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloud-CV/subscriptions","organizations_url":"https://api.github.com/users/Cloud-CV/orgs","repos_url":"https://api.github.com/users/Cloud-CV/repos","events_url":"https://api.github.com/users/Cloud-CV/events{/privacy}","received_events_url":"https://api.github.com/users/Cloud-CV/received_events","type":"Organization","site_admin":false},"repo":{"id":71516397,"name":"EvalAI","full_name":"Cloud-CV/EvalAI","owner":{"login":"Cloud-CV","id":20895851,"avatar_url":"https://avatars.githubusercontent.com/u/20895851?v=3","gravatar_id":"","url":"https://api.github.com/users/Cloud-CV","html_url":"https://github.com/Cloud-CV","followers_url":"https://api.github.com/users/Cloud-CV/followers","following_url":"https://api.github.com/users/Cloud-CV/following{/other_user}","gists_url":"https://api.github.com/users/Cloud-CV/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloud-CV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloud-CV/subscriptions","organizations_url":"https://api.github.com/users/Cloud-CV/orgs","repos_url":"https://api.github.com/users/Cloud-CV/repos","events_url":"https://api.github.com/users/Cloud-CV/events{/privacy}","received_events_url":"https://api.github.com/users/Cloud-CV/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cloud-CV/EvalAI","description":"EvalAI: A platform for hosting AI Challenges","fork":false,"url":"https://api.github.com/repos/Cloud-CV/EvalAI","forks_url":"https://api.github.com/repos/Cloud-CV/EvalAI/forks","keys_url":"https://api.github.com/repos/Cloud-CV/EvalAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cloud-CV/EvalAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cloud-CV/EvalAI/teams","hooks_url":"https://api.github.com/repos/Cloud-CV/EvalAI/hooks","issue_events_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/events{/number}","events_url":"https://api.github.com/repos/Cloud-CV/EvalAI/events","assignees_url":"https://api.github.com/repos/Cloud-CV/EvalAI/assignees{/user}","branches_url":"https://api.github.com/repos/Cloud-CV/EvalAI/branches{/branch}","tags_url":"https://api.github.com/repos/Cloud-CV/EvalAI/tags","blobs_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/{sha}","languages_url":"https://api.github.com/repos/Cloud-CV/EvalAI/languages","stargazers_url":"https://api.github.com/repos/Cloud-CV/EvalAI/stargazers","contributors_url":"https://api.github.com/repos/Cloud-CV/EvalAI/contributors","subscribers_url":"https://api.github.com/repos/Cloud-CV/EvalAI/subscribers","subscription_url":"https://api.github.com/repos/Cloud-CV/EvalAI/subscription","commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cloud-CV/EvalAI/contents/{+path}","compare_url":"https://api.github.com/repos/Cloud-CV/EvalAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cloud-CV/EvalAI/merges","archive_url":"https://api.github.com/repos/Cloud-CV/EvalAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cloud-CV/EvalAI/downloads","issues_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues{/number}","pulls_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls{/number}","milestones_url":"https://api.github.com/repos/Cloud-CV/EvalAI/milestones{/number}","notifications_url":"https://api.github.com/repos/Cloud-CV/EvalAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cloud-CV/EvalAI/labels{/name}","releases_url":"https://api.github.com/repos/Cloud-CV/EvalAI/releases{/id}","deployments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/deployments","created_at":"2016-10-21T00:51:45Z","updated_at":"2017-01-05T16:43:04Z","pushed_at":"2017-01-05T18:51:02Z","git_url":"git://github.com/Cloud-CV/EvalAI.git","ssh_url":"git@github.com:Cloud-CV/EvalAI.git","clone_url":"https://github.com/Cloud-CV/EvalAI.git","svn_url":"https://github.com/Cloud-CV/EvalAI","homepage":null,"size":1838,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":27,"forks":18,"open_issues":27,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343"},"html":{"href":"https://github.com/Cloud-CV/EvalAI/pull/343"},"issue":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/343"},"comments":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/7df920735dd54e42883c0314f7648acfbb62216e"}}}}
{"actor":{"display_login":"TroJan"}}