Skip to content

Commit

Permalink
Fixed bug on Jobs per month page where postgres was showing all jobs …
Browse files Browse the repository at this point in the history
…on same day in sparkline
  • Loading branch information
Airistotal committed Jun 22, 2015
1 parent e286c14 commit 895d09c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/galaxy/webapps/reports/controllers/jobs.py
Expand Up @@ -433,14 +433,16 @@ def per_month_all( self, trans, **kwd ):
order_by=[ _order ] )

# Use to make sparkline
all_jobs = sa.select( ( self.select_month(model.Job.table.c.create_time).label('date'), model.Job.table.c.id.label('id') ) )
all_jobs = sa.select( ( self.select_month(model.Job.table.c.create_time).label('month'),
self.select_day(model.Job.table.c.create_time).label('day'),
model.Job.table.c.id.label('id') ) )

trends = dict()
for job in all_jobs.execute():
job_day = int(job.date.strftime("%-d")) - 1
job_month = int(job.date.strftime("%-m"))
job_month_name = job.date.strftime("%B")
job_year = job.date.strftime("%Y")
job_day = int(job.day.strftime("%-d")) - 1
job_month = int(job.month.strftime("%-m"))
job_month_name = job.month.strftime("%B")
job_year = job.month.strftime("%Y")
key = str( job_month_name + job_year)

try:
Expand Down

0 comments on commit 895d09c

Please sign in to comment.