|
25 | 25 | """ |
26 | 26 |
|
27 | 27 | __author__ = 'GAM Team <google-apps-manager@googlegroups.com>' |
28 | | -__version__ = '7.34.08' |
| 28 | +__version__ = '7.34.09' |
29 | 29 | __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' |
30 | 30 |
|
31 | 31 | # pylint: disable=wrong-import-position |
@@ -46009,13 +46009,13 @@ def doCreateGuestUser(): |
46009 | 46009 | checkForExtraneousArguments() |
46010 | 46010 | try: |
46011 | 46011 | result = callGAPI(cd.users(), 'createGuest', |
46012 | | - throwReasons=[GAPI.FAILED_PRECONDITION], |
| 46012 | + throwReasons=[GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT], |
46013 | 46013 | body=body) |
46014 | 46014 | entityActionPerformed([Ent.GUEST_USER, body['primaryGuestEmail']]) |
46015 | 46015 | Ind.Increment() |
46016 | 46016 | showJSON(None, result) |
46017 | 46017 | Ind.Decrement() |
46018 | | - except (GAPI.failedPrecondition) as e: |
| 46018 | + except (GAPI.failedPrecondition, GAPI.invalidArgument) as e: |
46019 | 46019 | entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e)) |
46020 | 46020 |
|
46021 | 46021 | # gam <UserTypeEntity> update user <UserAttribute>* |
@@ -71340,6 +71340,13 @@ def updatePhoto(users): |
71340 | 71340 | continue |
71341 | 71341 | body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)} |
71342 | 71342 | 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 |
71343 | 71350 | callGAPI(cd.users().photos(), 'update', |
71344 | 71351 | throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET], |
71345 | 71352 | userKey=user, body=body, fields='') |
|
0 commit comments