[logic] Fix small bug in dictization

This commit is contained in:
amercader 2012-05-09 15:58:23 +01:00
parent 60274333c0
commit f0a09e8299
1 changed files with 7 additions and 5 deletions

View File

@ -59,12 +59,8 @@ def _get_source_status(source, context):
job_count = HarvestJob.filter(source=source).count()
if not job_count:
out['msg'] = 'No jobs yet'
return out
out = {
'job_count': job_count,
'job_count': 0,
'next_harvest':'',
'last_harvest_request':'',
'last_harvest_statistics':{'added':0,'updated':0,'errors':0},
@ -72,6 +68,12 @@ def _get_source_status(source, context):
'overall_statistics':{'added':0, 'errors':0},
'packages':[]}
if not job_count:
out['msg'] = 'No jobs yet'
return out
else:
out['job_count'] = job_count
# Get next scheduled job
next_job = HarvestJob.filter(source=source,status=u'New').first()
if next_job: