Skip to content
Permalink
Browse files

Early return from AMT if assignment doesn't exist.

  • Loading branch information...
thisisdhaas committed Jul 10, 2015
1 parent ca05bb4 commit 00443d9731e7777b9a5191b5dd900b6b884cb713
Showing with 2 additions and 0 deletions.
  1. +2 −0 ampcrowd/amt/connection.py
@@ -143,6 +143,7 @@ def reject_assignment(assignment, reason):
conn = get_amt_connection(crowd_config['sandbox'])
if not assignment_exists(assignment):
logger.warn("No assignment--not rejecting it.")
return

try:
conn.reject_assignment(assignment.assignment_id, reason)
@@ -156,6 +157,7 @@ def bonus_worker(worker, assignment, amount, reason):
conn = get_amt_connection(crowd_config['sandbox'])
if not assignment_exists(assignment):
logger.warn("No assignment--not granting it a bonus.")
return

try:
conn.grant_bonus(worker.worker_id, assignment.assignment_id,

0 comments on commit 00443d9

Please sign in to comment.
You can’t perform that action at this time.