Skip to content

Commit 5401041

Browse files
committed
Fixed bug in gam report admin|chrome
1 parent 3a23559 commit 5401041

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/GamUpdate.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
7.31.04
22

3+
Fixed bug in `gam report admin|chrome` that caused to events to not be displayed.
4+
35
Updated `gam <UserTypeEntity> print|show messages|threads ... query <QueryGmail>` to display the query.
46

57
7.31.03

src/gam/__init__.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14476,6 +14476,7 @@ def _computeUsedQuotaInPercentage(events):
1447614476
for eventName in eventNames:
1447714477
zeroEventCounts[eventName] = 0
1447814478
mapUsersToFilter = False
14479+
count = len(users)
1447914480
# gmail requires a start time and an end time no more than 30 days apart
1448014481
if report == 'gmail':
1448114482
if startEndTime.startTime is None:
@@ -14491,32 +14492,34 @@ def _computeUsedQuotaInPercentage(events):
1449114492
# unless userisactor was specified
1449214493
elif report == 'admin':
1449314494
if mapAdminUsersToFilter:
14494-
if filters is None or 'USER_EMAIL==' not in filters:
14495-
mapUsersToFilter = True
14495+
if select or count != 1 or users[0] != 'all':
1449614496
if filters is None:
14497+
mapUsersToFilter = True
1449714498
filters = 'USER_EMAIL==#user#'
14498-
else:
14499+
elif 'USER_EMAIL==' not in filters:
14500+
mapUsersToFilter = True
1449914501
filters = filters+',USER_EMAIL==#user#'
1450014502
# chrome does not use userKey, map user to filter DEVICE_USER==user
1450114503
elif report == 'chrome':
14502-
if filters is None or 'DEVICE_USER==' not in filters:
14503-
mapUsersToFilter = True
14504+
if select or count != 1 or users[0] != 'all':
1450414505
if filters is None:
14506+
mapUsersToFilter = True
1450514507
filters = 'DEVICE_USER==#user#'
14506-
else:
14508+
elif 'DEVICE_USER==' not in filters:
14509+
mapUsersToFilter = True
1450714510
filters = filters+',DEVICE_USER==#user#'
1450814511
i = 0
14509-
count = len(users)
1451014512
for user in users:
1451114513
i += 1
1451214514
if normalizeUsers:
1451314515
user = normalizeEmailAddressOrUID(user)
1451414516
pfilters = filters
1451514517
if select or user != 'all':
14518+
puser = user
1451614519
if mapUsersToFilter:
1451714520
pfilters = filters.replace('#user#', user)
1451814521
user = 'all'
14519-
printGettingAllEntityItemsForWhom(Ent.ACTIVITY, user, i, count, query=pfilters)
14522+
printGettingAllEntityItemsForWhom(Ent.ACTIVITY, puser, i, count, query=pfilters)
1452014523
for eventName in eventNames:
1452114524
try:
1452214525
feed = callGAPIpages(service, 'list', 'items',

0 commit comments

Comments
 (0)