reason not valid woth readonly false; add contentrestrions to file field list (#1263)

This commit is contained in:
Ross Scroggs
2020-10-09 08:28:27 -07:00
committed by GitHub
parent e356fe3e85
commit 9585f6c598
2 changed files with 6 additions and 1 deletions

View File

@ -3538,7 +3538,11 @@ def getDriveFileAttribute(i, body, parameters, myarg, update=False):
sys.argv[i+2], f'gam <users> {operation} drivefile')
i += 3
if len(sys.argv) > i and sys.argv[i].lower() == 'reason':
body['contentRestrictions'][0]['reason'] = sys.argv[i+1]
if body['contentRestrictions'][0]['readOnly']:
body['contentRestrictions'][0]['reason'] = sys.argv[i+1]
else:
controlflow.invalid_argument_exit(
'reason', 'contentrestrictions readonly false')
i += 2
else:
controlflow.invalid_argument_exit(