Fix gam transfer drive to properly handle orphaned files (#380)

This commit is contained in:
Ross Scroggs
2017-01-04 16:19:49 -08:00
committed by Jay Lee
parent d7187ff998
commit ac2cbef7f8

View File

@ -4183,6 +4183,8 @@ def transferDriveFiles(users):
target_parents.append({u'id': parent[u'id']})
except TypeError:
pass
if not target_parents:
target_parents.append({u'id': target_top_folder})
callGAPI(target_drive.files(), u'patch', soft_errors=True, retry_reasons=[u'notFound'], fileId=file_id, body={u'parents': target_parents})
if remove_source_user:
callGAPI(target_drive.permissions(), u'delete', soft_errors=True, fileId=file_id, permissionId=source_permissionid)