From 65d3065f4f47e9ded9d79a36b85ca7386661797b Mon Sep 17 00:00:00 2001 From: Paul Abumov Date: Thu, 16 Nov 2023 18:41:36 -0500 Subject: [PATCH] Added sanity check for Mturk sandbox testing --- mephisto/abstractions/providers/mturk/mturk_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mephisto/abstractions/providers/mturk/mturk_utils.py b/mephisto/abstractions/providers/mturk/mturk_utils.py index 2cc85246e..6a3109522 100644 --- a/mephisto/abstractions/providers/mturk/mturk_utils.py +++ b/mephisto/abstractions/providers/mturk/mturk_utils.py @@ -439,7 +439,8 @@ def create_hit_type( has_locale_qual = True locale_requirements += existing_qualifications - if not has_locale_qual and not client_is_sandbox(client): + is_sandbox = client_is_sandbox(client) + if not has_locale_qual and not is_sandbox: allowed_locales = get_config_arg("mturk", "allowed_locales") if allowed_locales is None: allowed_locales = [ @@ -458,6 +459,9 @@ def create_hit_type( } ) + if is_sandbox: + hit_reward = 0 + # Create the HIT type response = client.create_hit_type( AutoApprovalDelayInSeconds=auto_approve_delay,