mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Updated gam <UserTypeEntity> update photo
This commit is contained in:
@@ -1,7 +1,19 @@
|
|||||||
|
7.34.09
|
||||||
|
|
||||||
|
Updated `gam <UserTypeEntity> update photo` to delete the user's existing photo
|
||||||
|
before performing the update as the API update will succeed but not replace a user's existing self-set photo.
|
||||||
|
|
||||||
|
7.34.08
|
||||||
|
|
||||||
|
Rebuild to avoid the following error:
|
||||||
|
```
|
||||||
|
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!
|
||||||
|
```
|
||||||
|
|
||||||
7.34.07
|
7.34.07
|
||||||
|
|
||||||
Added the following command to create a guest user.
|
Added the following command to create a guest user.
|
||||||
* See: https://support.google.com/a/answer/16558545?hl=en
|
* See: https://support.google.com/a/answer/16558545
|
||||||
```
|
```
|
||||||
gam create guestuser <EmailAddress>
|
gam create guestuser <EmailAddress>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.34.08'
|
__version__ = '7.34.09'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
# pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
@@ -46009,13 +46009,13 @@ def doCreateGuestUser():
|
|||||||
checkForExtraneousArguments()
|
checkForExtraneousArguments()
|
||||||
try:
|
try:
|
||||||
result = callGAPI(cd.users(), 'createGuest',
|
result = callGAPI(cd.users(), 'createGuest',
|
||||||
throwReasons=[GAPI.FAILED_PRECONDITION],
|
throwReasons=[GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT],
|
||||||
body=body)
|
body=body)
|
||||||
entityActionPerformed([Ent.GUEST_USER, body['primaryGuestEmail']])
|
entityActionPerformed([Ent.GUEST_USER, body['primaryGuestEmail']])
|
||||||
Ind.Increment()
|
Ind.Increment()
|
||||||
showJSON(None, result)
|
showJSON(None, result)
|
||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
except (GAPI.failedPrecondition) as e:
|
except (GAPI.failedPrecondition, GAPI.invalidArgument) as e:
|
||||||
entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e))
|
entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e))
|
||||||
|
|
||||||
# gam <UserTypeEntity> update user <UserAttribute>*
|
# gam <UserTypeEntity> update user <UserAttribute>*
|
||||||
@@ -71340,6 +71340,13 @@ def updatePhoto(users):
|
|||||||
continue
|
continue
|
||||||
body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)}
|
body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)}
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
|
callGAPI(cd.users().photos(), 'delete',
|
||||||
|
bailOnInternalError=True,
|
||||||
|
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.PHOTO_NOT_FOUND, GAPI.INTERNAL_ERROR],
|
||||||
|
userKey=user)
|
||||||
|
except (GAPI.photoNotFound, GAPI.internalError) as e:
|
||||||
|
pass
|
||||||
callGAPI(cd.users().photos(), 'update',
|
callGAPI(cd.users().photos(), 'update',
|
||||||
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET],
|
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET],
|
||||||
userKey=user, body=body, fields='')
|
userKey=user, body=body, fields='')
|
||||||
|
|||||||
Reference in New Issue
Block a user