Repository: Cloud-CV/EvalAI
Issue: Add a check for ChallengeHostTeam Ownership in Challenge Creation API
Root cause: Validation Gap

In challenge creation API (https://github.com/Cloud-CV/EvalAI/blob/master/apps/challenges/views.py#L28), we should add a check if the `<challenge_host_team_pk>` belongs to the user making the request. 

I think it's related to #324 . So is it okay if I try both 

Both are independent but if you are willing to solve both of these then you are good to go. 

Also, please make sure that you open two different PRs for both of these issues. 

Okay . I'll try .

can you help me with something when i try 
`curl -X  POST -H "Authorization: Token id" "http://localhost:8000/api/challenges/challenge_host_team/1/challenge" `
i get this error message. I was not getting earlier. 

`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Notification: Gateway Timeout</title>

<style type="text/css">
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color:#333333;
  background-color: #ffffff;
}
h1 {
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  padding-top: 0px;
  color: #2970A6;
}
a:link {
    color: #2970A6;
  text-decoration: none;
}
a:hover {
    color: #2970A6;
  text-decoration: underline;
}
p.buttonlink {
  margin-bottom: 24px;
}
.copyright {
  font-size: 12px;
  color: #666666;
  margin: 5px 5px 0px 30px;

}
.details {
  font-size: 14px;
  color: #969696;
  border: none;
  padding: 20px 20px 20px 20px;
  margin: 0px 10px 10px 35px;
}

.shadow {
  border: 3px solid #9f9f9f;
  padding: 10px 25px 10px 25px;
  margin: 10px 35px 0px 30px;
  background-color: #ffffff;
  width: 600px;

  -moz-box-shadow: 3px 3px 3px #cccccc;
  -webkit-box-shadow: 3px 3px 3px #cccccc;
  box-shadow: 3px 3px 3px #cccccc;
  /* For IE 8 */
  -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc')";
  /* For IE 5.5 - 7 */
  filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc');
}
.logo {
  border: none;
  margin: 5px 5px 0px 30px;
}
</style>

</head>

<body>
<div class="logo"></div><p>&nbsp;</p>
<div class="shadow">
<h1>This Page Cannot Be Displayed</h1>


<p>
The system cannot communicate with the external server (&nbsp;localhost&nbsp;).
The Internet server may be busy, may be permanently down, or may be
unreachable because of network problems.
</p>

<p>
Please check the spelling of the Internet address entered.
If it is correct, try this request later.
</p>



<p>
If you have questions, please contact
your organization's network administrator 
and provide the codes shown below.
</p>

</div>

<div class="details"><p>
Date: Wed, 04 Jan 2017 10:53:25 GMT<br />
Username: iim2014008@iiita<br />
Source IP: 172.26.43.118<br />
URL: POST http://localhost/api/challenges/challenge_host_team/1/challenge<br />
Category: <br />
Reason: UNKNOWN<br />
Notification: GATEWAY_TIMEOUT
</p></div>
</body>
</html>
`


It was working fine earlier :-1: 

@gauthamzz seeing the line `URL: POST http://localhost/api/challenges/challenge_host_team/1/challenge` , it looks like you are not adding the port 8000 and there is no web app running on port 80 and hence it gives you a timeout error. 

How do i fix it ? any ideas ?

in curl i gave the port.

btw im under proxy is this due to that

@deshraj I am interested in working on the issue.

@souravsingh This one is already fixed. The PR is under review. 

Close this ? @deshraj 

Yup sure. Thanks for your help in solving this issue. :-)