Skip to content

Commit 67a6d3f

Browse files
committed
Updated gam <UserTypeEntity> update photo
1 parent 7987a94 commit 67a6d3f

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/GamUpdate.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
7.34.09
2+
3+
Updated `gam <UserTypeEntity> update photo` to delete the user's existing photo
4+
before performing the update as the API update will succeed but not replace a user's existing self-set photo.
5+
6+
7.34.08
7+
8+
Rebuild to avoid the following error:
9+
```
10+
requests/__init__.py:113: RequestsDependencyWarning: urllib3 (2.6.3) or chardet (6.0.0.post1)/charset_normalizer (3.4.4) doesn't match a supported version!
11+
```
12+
113
7.34.07
214

315
Added the following command to create a guest user.
4-
* See: https://support.google.com/a/answer/16558545?hl=en
16+
* See: https://support.google.com/a/answer/16558545
517
```
618
gam create guestuser <EmailAddress>
719
```

src/gam/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"""
2626

2727
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
28-
__version__ = '7.34.08'
28+
__version__ = '7.34.09'
2929
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
3030

3131
# pylint: disable=wrong-import-position
@@ -46009,13 +46009,13 @@ def doCreateGuestUser():
4600946009
checkForExtraneousArguments()
4601046010
try:
4601146011
result = callGAPI(cd.users(), 'createGuest',
46012-
throwReasons=[GAPI.FAILED_PRECONDITION],
46012+
throwReasons=[GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT],
4601346013
body=body)
4601446014
entityActionPerformed([Ent.GUEST_USER, body['primaryGuestEmail']])
4601546015
Ind.Increment()
4601646016
showJSON(None, result)
4601746017
Ind.Decrement()
46018-
except (GAPI.failedPrecondition) as e:
46018+
except (GAPI.failedPrecondition, GAPI.invalidArgument) as e:
4601946019
entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e))
4602046020

4602146021
# gam <UserTypeEntity> update user <UserAttribute>*
@@ -71340,6 +71340,13 @@ def updatePhoto(users):
7134071340
continue
7134171341
body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)}
7134271342
try:
71343+
try:
71344+
callGAPI(cd.users().photos(), 'delete',
71345+
bailOnInternalError=True,
71346+
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.PHOTO_NOT_FOUND, GAPI.INTERNAL_ERROR],
71347+
userKey=user)
71348+
except (GAPI.photoNotFound, GAPI.internalError) as e:
71349+
pass
7134371350
callGAPI(cd.users().photos(), 'update',
7134471351
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET],
7134571352
userKey=user, body=body, fields='')

0 commit comments

Comments
 (0)