Changes between Initial Version and Version 1 of Ticket #10356, comment 15


Ignore:
Timestamp:
Jul 10, 2013, 5:04:40 PM (11 years ago)
Author:
Jun Omae
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10356, comment 15

    initial v1  
    11Had to also add handling for anonymous users. I guess our JIRA allowes creation of Components without leads causing a KeyError: 'lead' when it's missing:
     2{{{#!python
    23        elif name == 'Component':
    3             component = {'project': attrs\['project'\], 'id': attrs\['id'\],
    4                          'name': attrs\['name'\], 'owner': attrs\['lead'\]}
     4            component = {'project': attrs['project'], 'id': attrs['id'],
     5                         'name': attrs['name'], 'owner': attrs['lead']}
    56
    67            try:
    7                 component\[\'description\'\] = attrs\[\'description\'\]
     8                component['description'] = attrs['description']
    89            except KeyError:
    9                 component\['description'\] = ''
     10                component['description'] = ''
    1011
    1112            try:
    12                 component\['owner'\] = attrs\['lead'\]
     13                component['owner'] = attrs['lead']
    1314            except KeyError:
    14                 component\['owner'\] = 'anonymous'
     15                component['owner'] = 'anonymous'
     16}}}