Fix a bug in print_list when using formatters
If using formatters it will raise a error that local variable 'data' referenced before assignment story: 2008472 task: 41511 Change-Id: I6c66139b54a203bd8af01e8534e4d7ce7735e02d
This commit is contained in:
parent
7c89521ae4
commit
182301ac68
@ -173,7 +173,7 @@ def print_list(objs, fields, formatters={}, order_by=None, obj_is_dict=False,
|
||||
row = []
|
||||
for field in fields:
|
||||
if formatters and field in formatters:
|
||||
row.append(formatters[field](obj))
|
||||
data = formatters[field](obj)
|
||||
elif obj_is_dict:
|
||||
data = obj.get(field, '')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user