This commit is contained in:
Ross Scroggs
2019-05-17 06:28:28 -07:00
committed by Jay Lee
parent d9ba83217f
commit 4b8bc4e7ea

View File

@@ -1604,18 +1604,18 @@ def showReport():
if 'entity' not in user_report: if 'entity' not in user_report:
continue continue
row = {'email': user_report['entity']['userEmail'], 'date': tryDate} row = {'email': user_report['entity']['userEmail'], 'date': tryDate}
try: for item in user_report.get('parameters', []):
for report_item in user_report['parameters']: if 'name' not in item:
items = list(report_item.values()) continue
if len(items) < 2: name = item['name']
continue if not name in titles:
name = items[1] titles.append(name)
value = items[0] for ptype in ['intValue', 'boolValue', 'datetimeValue', 'stringValue']:
if not name in titles: if ptype in item:
titles.append(name) row[name] = item[ptype]
row[name] = value break
except KeyError: else:
pass row[name] = ''
csvRows.append(row) csvRows.append(row)
writeCSVfile(csvRows, titles, 'User Reports - %s' % tryDate, to_drive) writeCSVfile(csvRows, titles, 'User Reports - %s' % tryDate, to_drive)
elif report in ['customer', 'customers', 'domain']: elif report in ['customer', 'customers', 'domain']: