From f737a39aaee66d363701bac9a3df7c1dc085f389 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 17 Aug 2010 21:29:26 +0200 Subject: tracking: Fix labels in track_status(). --- modules/tracking.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'modules') diff --git a/modules/tracking.py b/modules/tracking.py index 5d10a24..89e3d49 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -160,20 +160,15 @@ class Module: for row in consignments: i = 0 if row.label: - label_header = True - results.append('Packages for \002%s\002:' % row.label) + label = ' (%s)' % row.label else: - label_header = False + label = '' + for package in row.packages: i += 1 date = package.last desc = package.status - if package.code == row.code and row.label: - label = ' (%s)' % row.label - else: - label = '' - if date and desc: s = '\002%s\002%s %s - %s' % (package.code, label, date, desc) else: @@ -182,16 +177,8 @@ class Module: results.append(s) if i == 0: - if row.label: - label = ' (%s)' % row.label - else: - label = '' results.append('No packages found for \002%s\002%s' % (row.code, label)) - if label_header: - del results[0] - label_header = False - if len(results): msg = results else: -- cgit v1.2.3