error will be thrown on expired hit. ignore

This commit is contained in:
Ruben van de Ven 2021-08-10 13:34:21 +02:00
parent 69066588d9
commit 242d936723
1 changed files with 16 additions and 13 deletions

View File

@ -98,19 +98,22 @@ class Connection():
logger.debug(f"Save {answer_filename}")
json.dump(assignment, fp, cls=DateTimeEncoder, indent=4)
if not confirm("Accept input of worker (no = reject!!)", True) and confirm("Are you sure you want to reject this user?! (reason in next step)", False):
# reject
reason = input("Reason for rejection (no newlines)")
response = self.mturk.reject_assignment(
AssignmentId=assignment['AssignmentId'],
RequesterFeedback=reason
)
else:
response = self.mturk.approve_assignment(
AssignmentId=assignment['AssignmentId']
# RequesterFeedback=reason
)
try:
if not confirm("Accept input of worker (no = reject!!)", True) and confirm("Are you sure you want to reject this user?! (reason in next step)", False):
# reject
reason = input("Reason for rejection (no newlines)")
response = self.mturk.reject_assignment(
AssignmentId=assignment['AssignmentId'],
RequesterFeedback=reason
)
else:
response = self.mturk.approve_assignment(
AssignmentId=assignment['AssignmentId']
# RequesterFeedback=reason
)
except Exception as e:
logger.danger("ignoring exception on accepting/rejecting assignment!")
logger.exception(e)
# save with new status after all processing is succesfull
with open(hit_file, 'w') as fp: