~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/distributionsourcepackage.py

  • Committer: Julian Edwards
  • Date: 2009-08-27 19:21:05 UTC
  • mto: This revision was merged to the branch mainline in revision 9299.
  • Revision ID: julian.edwards@canonical.com-20090827192105-ix2239idces9oef2
Add a load of tests and fix broken stuff that they exposed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
421
421
            pocket_dict = self.published_by_version(package)
422
422
            for version in pocket_dict.iterkeys():
423
423
                most_recent_publication = pocket_dict[version][0]
 
424
                if most_recent_publication.datepublished is None:
 
425
                    published_since = None
 
426
                else:
 
427
                    published_since = datetime.now(
 
428
                        tz=pytz.UTC) - most_recent_publication.datepublished
424
429
                row = {
425
430
                    'blank_row': False,
426
431
                    'title_row': False,
430
435
                    'pockets': ", ".join(
431
436
                        [pub.pocket.name for pub in pocket_dict[version]]),
432
437
                    'component': most_recent_publication.component_name,
433
 
                    'published_since': datetime.now(
434
 
                        tz=pytz.UTC) - most_recent_publication.datepublished,
 
438
                    'published_since': published_since,
435
439
                    }
436
440
                rows.append(row)
437
441
            # We need a blank row after each section, so the series