Skip to content

Commit

Permalink
fix logic issue in get_worker_url, updated code that generates return…
Browse files Browse the repository at this point in the history
… hit url
  • Loading branch information
rwblair committed Jul 7, 2016
1 parent c0574b0 commit a6a53a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion expdj/apps/turk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def is_sandbox():
def get_worker_url():
"""Get proper URL depending upon sandbox settings"""

if is_sandbox():
if settings.MTURK_ALLOW == False:
return SANDBOX_WORKER_URL
else:
return PRODUCTION_WORKER_URL
Expand Down
10 changes: 7 additions & 3 deletions expdj/apps/turk/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,16 @@ def check_battery_view(battery, worker_id, hit):
"{host}/mturk/return?requesterId={worker_id}&hitId={hit_id}&"
"groupId={group_id}&canAccept=&externalHit=true"
)
return_hit_url.format({
'host': get_host(),
worker_url = get_worker_url()
format_data = {
'host': worker_url,
'worker_id': worker_id,
'hit_id': hit.mturk_id,
'group_id': hit.hit_type_id,
})
}
print(format_data)
return_hit_url = return_hit_url.format(**format_data)
print(return_hit_url)
return render_to_response(
"experiments/battery_requirements_not_met.html",
context={'missing_batteries': missing_batteries,
Expand Down

0 comments on commit a6a53a5

Please sign in to comment.