~bac/charmworld/tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/tools.py

  • Committer: Matthew Scott
  • Date: 2014-03-06 20:32:51 UTC
  • mfrom: (489 trunk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: matthew.scott@canonical.com-20140306203251-ve388tpu1av0coqz
Merge with trunk to resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    qaed_charms = [(a['name'], a['series']) for a in
28
28
                   qa_source.answers.find()]
29
29
    return [charm for charm in source.find_promulgated_charms() if
30
 
                     (charm.name, charm.series) not in qaed_charms]
 
30
            (charm.name, charm.series) not in qaed_charms]
31
31
 
32
32
 
33
33
def get_qa_entry_data(item):
118
118
    review_queue = build_review_queue(request)
119
119
 
120
120
    stats = list(request.db.review_queue_latency.find(
121
 
        date={"$gte": datetime.datetime.utcnow() - datetime.timedelta(180)},
 
121
        date={"$gte": datetime.datetime.utcnow() - datetime.timedelta(90)},
122
122
        sort=[('date_modified', pymongo.ASCENDING)]))
123
123
    sparklines = get_sparklines(stats)
124
124
    if stats:
125
 
        current_stats = stats[0]
 
125
        current_stats = stats[-1]
126
126
        mean_latency = utils.prettify_timedelta(
127
127
            datetime.timedelta(seconds=current_stats['mean']))
128
128
    else: