[#5] Allow not returning error summary on job dictize
This commit is contained in:
parent
8576ad6784
commit
e1ce0b7267
|
@ -216,7 +216,8 @@ def harvest_job_list(context,data_dict):
|
||||||
|
|
||||||
jobs = query.all()
|
jobs = query.all()
|
||||||
|
|
||||||
return [harvest_job_dictize(job,context) for job in jobs]
|
context['return_error_summary'] = False
|
||||||
|
return [harvest_job_dictize(job, context) for job in jobs]
|
||||||
|
|
||||||
def harvest_object_show(context,data_dict):
|
def harvest_object_show(context,data_dict):
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ def harvest_job_dictize(job, context):
|
||||||
for error in job.gather_errors:
|
for error in job.gather_errors:
|
||||||
out['gather_errors'].append(error.as_dict())
|
out['gather_errors'].append(error.as_dict())
|
||||||
|
|
||||||
|
if context.get('return_error_summary', True):
|
||||||
q = model.Session.query(HarvestObjectError.message, \
|
q = model.Session.query(HarvestObjectError.message, \
|
||||||
func.count(HarvestObjectError.message).label('error_count')) \
|
func.count(HarvestObjectError.message).label('error_count')) \
|
||||||
.join(HarvestObject) \
|
.join(HarvestObject) \
|
||||||
|
|
Loading…
Reference in New Issue