Classroom: Can't change ownerId using courses().patch
See original GitHub issueEnvironment details
- OS type and version: Windows 10
- Python version: 3.8.2
- pip version: 20.1
google-api-python-client
version: 1.8.2
Steps to reproduce
- Trying to update ownerId of a Classroom results in error
400: Request contains an invalid argument
- Using the web api from https://developers.google.com/classroom/reference/rest/v1/courses/patch works just fine
- New owner is already a teacher in the course I’m trying to update
Code example
id = 89400224434
email = 'email@email.com'
body = {
'ownerId': email
}
classroom.courses().patch(id=id, body=body, updateMask='ownerId').execute()
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to change course owner using Classroom.Courses.patch()
I just tried this a few moments ago and it worked. Take into account that, for this to work, the user must already...
Read more >Can't Change Owner of Classroom/Course - Google Groups
If the original owner has been deleted, and it's been more than 20 days ago, it is no longer possible to transfer the...
Read more >Manage Courses | Google Classroom API
Then, call courses.patch() and specify the co-teacher's email or user id in the ownerId field of the request object to update the course...
Read more >Can't transfer classroom ownership - Google Help
In other words, when I invite one teacher to become owner they get the email and it works fine. When I ask another...
Read more >Changing Case Owner in With sharing class
Is my assumption correct that with sharing class doesn't check the access if we update only "ownerId" for that record ?? Thanks in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. When I try to use the tool directly from the API page it works. (https://developers.google.com/classroom/reference/rest/v1/courses/patch). I believe it has something to do with the Python Client not recognizing “ownerId” as a valid updateMask and/or a valid field in the body of the request of courses.patch()
No problem, thanks for the update!