Skip to content

Commit

Permalink
Tests for posting task runs with external UID.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Aug 2, 2016
1 parent 097d214 commit 38b64f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pybossa/api/task_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def _validate_project_and_task(self, taskrun, task):
if taskrun.external_uid:
resp = jwt_authorize_project(task.project,
request.headers.get('Authorization'))
msg = json.loads(resp.data)['description']
if type(resp) == Response:
msg = json.loads(resp.data)['description']
raise Forbidden(msg)

def _ensure_task_was_requested(self, task, guard):
Expand Down
2 changes: 1 addition & 1 deletion test/test_sched.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def test_task_preloading_external_uid(self):
external_uid='2xb')
tr = json.dumps(tr)

self.app.post('/api/taskrun', data=tr)
res = self.app.post('/api/taskrun', data=tr, headers=headers)
# Get two tasks again
res = self.app.get(url, headers=headers)
task3 = json.loads(res.data)
Expand Down

0 comments on commit 38b64f7

Please sign in to comment.