code: def debug_complete():
      ''' Debugging route for complete. '''
      if not 'uniqueId' in request.args:
          raise ExperimentError('improper_inputs')
      else:
          unique_id = request.args['uniqueId']
          mode = request.args['mode']
          try:
              user = Participant.query.\
                  filter(Participant.uniqueid == unique_id).one()
              user.status = COMPLETED
              user.endhit = datetime.datetime.now()
              db_session.add(user)
              db_session.commit()
          except:
              raise ExperimentError('error_setting_worker_complete')
          else:
              if (mode == 'sandbox' or mode == 'live'): # send them back to mturk.
                  return render_template('closepopup.html')
              else:
                  return render_template('complete.html'f debug_complete():
      ''' Debugging route for complete. '''
      if not 'uniqueId' in request.args:
          raise ExperimentError('improper_inputs')
      else:
          unique_id = request.args['uniqueId']
          mode = request.args['mode']
          try:
              user = Participant.query.\
                  filter(Participant.uniqueid == unique_id).one()
              user.status = COMPLETED
              user.endhit = datetime.datetime.now()
              db_session.add(user)
              db_session.commit()
          except:
              raise ExperimentError('error_setting_worker_complete')
          else:
              if (mode == 'sandbox' or mode == 'live'): # send them back to mturk.
                  return render_template('closepopup.html')
              else:
                  return render_template('complete.html')
docs: Debugging route for complete.