make the errors component of the info response only appear if there IS an error + make the integration test check for the proper error returns

This commit is contained in:
Aaron Blankstein
2017-06-30 16:25:32 -04:00
parent 7921a23f41
commit a9eefbb5fa
3 changed files with 12 additions and 3 deletions

View File

@@ -435,8 +435,9 @@ def get_queue_state(queue_ids=None, limit=None, path=DEFAULT_QUEUE_PATH):
state += rows
for row in state:
row['errors'] = queue_get_error_msgs(row['type'], row['fqu'], path=path)
errors = queue_get_error_msgs(row['type'], row['fqu'], path=path)
if len(errors) > 0:
row['errors'] = errors
return state