~brad-figg/arsenal/process-new-bugs

« back to all changes in this revision

Viewing changes to scripts/arsenal_lib.py

  • Committer: Bryce Harrington
  • Date: 2010-03-17 20:28:17 UTC
  • Revision ID: bryce@canonical.com-20100317202817-eva3iy5v53xzprkw
Look up source package given the bug task

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
        try:
144
144
            # LP raises "410: Gone" error if account is disabled
145
145
            self.owner = bug.owner
146
 
            if self.owner and self.owner.name:
147
 
                self.owner_firstname = self.owner.name.split(' ')[0]
 
146
            if self.owner and self.owner.display_name:
 
147
                self.owner_firstname = self.owner.display_name.split(' ')[0]
148
148
        except:
149
149
            self.owner = None
150
150
            self.owner_firstname = ""
401
401
 
402
402
 
403
403
 
404
 
def bugtask_as_dict(arsenal_bug, bugtask, source_pkg):
 
404
def bugtask_as_dict(arsenal_bug, bugtask):
405
405
    assignee = None
406
406
    if bugtask.assignee:
407
407
        assignee = bugtask.assignee.name.encode('utf-8')
414
414
    date_fix_released = None
415
415
    if bugtask.date_fix_released:
416
416
        date_fix_released = bugtask.date_fix_released.ctime()
 
417
    source_pkg = string.replace(bugtask.bug_target_display_name, " (Ubuntu)", "")
417
418
 
418
419
    tag_list = bugtask.bug.tags
419
420
    bugtask_dict = {
428
429
        'is_complete'      : bugtask.is_complete,
429
430
        'assignee'         : assignee,
430
431
        'reporter'         : reporter,
431
 
        'target'           : string.replace(source_pkg, " (Ubuntu)", ""),
 
432
        'target'           : source_pkg,
432
433
        'tags'             : tag_list,
433
434
        'status'           : numerical_status(bugtask.status),
434
435
        'importance'       : numerical_importance(bugtask.importance),