Commit 223d86d1 authored by Thomas Uram's avatar Thomas Uram

Fix reference

parent 0e14f381
......@@ -146,17 +146,17 @@ class Command(BaseCommand):
elif qmsg.code == QueueMessage.TransitionDbConnectionFailed:
logger.error('Transition DB connection failed: ' + qmsg.message)
job = models.BalsamJob.objects.get(pk=qmsg.pk)
job.state = models.STATE_BY_NAME[job.state].failed_state
job.state = models.STATES_BY_NAME[job.state].failed_state
job.save(update_fields=['state'])
elif qmsg.code == QueueMessage.TransitionDbRetrieveFailed:
logger.error('Transition failed to retrieve job from DB: ' + qmsg.message)
job = models.BalsamJob.objects.get(pk=qmsg.pk)
job.state = models.STATE_BY_NAME[job.state].failed_state
job.state = models.STATES_BY_NAME[job.state].failed_state
job.save(update_fields=['state'])
elif qmsg.code == QueueMessage.TransitionFunctionException:
logger.error('Exception received while running transition function: ' + qmsg.message)
job = models.BalsamJob.objects.get(pk=qmsg.pk)
job.state = models.STATE_BY_NAME[job.state].failed_state
job.state = models.STATES_BY_NAME[job.state].failed_state
job.save(update_fields=['state'])
else:
logger.error('No recognized QueueMessage code')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment