question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Classroom: Can't change ownerId using courses().patch

See original GitHub issue

Environment 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

  1. Trying to update ownerId of a Classroom results in error 400: Request contains an invalid argument
  2. Using the web api from https://developers.google.com/classroom/reference/rest/v1/courses/patch works just fine
  3. 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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MaKTaiLcommented, May 13, 2020

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()

0reactions
busunkim96commented, May 15, 2020

No problem, thanks for the update!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found