Changes between Initial Version and Version 1 of Ticket #10356, comment 15
- Timestamp:
- Jul 10, 2013, 5:04:40 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10356, comment 15
initial v1 1 1 Had 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 2 3 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']} 5 6 6 7 try: 7 component \[\'description\'\] = attrs\[\'description\'\]8 component['description'] = attrs['description'] 8 9 except KeyError: 9 component \['description'\] = ''10 component['description'] = '' 10 11 11 12 try: 12 component \['owner'\] = attrs\['lead'\]13 component['owner'] = attrs['lead'] 13 14 except KeyError: 14 component\['owner'\] = 'anonymous' 15 component['owner'] = 'anonymous' 16 }}}