Python API: Delete a user from a review group

141 views
Skip to first unread message

Steve

unread,
Sep 2, 2015, 12:29:16 PM9/2/15
to reviewboard
I'm trying to remove users from review groups using the Python API.  The docs indicate that the review group user resource has a delete method, but I can't figure out how to get it to work.  I can add a user to a group easily this way:

g.get_users().create(username='steve')

Unfortunately, this doesn't work:

g.get_users().delete(username='steve')

Nor does this:

g.get_user()[0].delete() 

or any other incarnation I've tried.  Can somebody point me in the right direction?

Thanks!

--Steve

Steven MacLeod

unread,
Sep 2, 2015, 5:24:50 PM9/2/15
to revie...@googlegroups.com
It looks like it's not actually possible to delete a user from a review group using the Python API at the moment. Review Board seems to be returning an incorrect url which points to the user resource itself, rather than the review-group-user resource for the delete link. you can see that by looking at the example here: https://www.reviewboard.org/docs/manual/dev/webapi/2.0/resources/review-group-user/#example_application/vnd.reviewboard.org.user+json

"delete": {
    "href": "http://reviews.example.com/api/users/doc/",
    "method": "DELETE"
},

This is a bug in Review Board and will need to be fixed there to allow this.
 

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve

unread,
Sep 2, 2015, 6:11:41 PM9/2/15
to reviewboard
Thanks Steven for confirming that.  I thought maybe I was going crazy!

--Steve

Steve

unread,
Sep 3, 2015, 12:04:19 PM9/3/15
to reviewboard
Sorry I'm back.  Since I can't remove a user from a group using the API, I thought instead  I would make the user account inactive via the API. But I can't find a resource for that.  Is the 'active' flag for a user account exposed somewhere in the API?

I'm just trying to programmatically prevent departed employees from ending up in review requests when they're members of review groups.

--Steve

Christian Hammond

unread,
Sep 3, 2015, 4:45:36 PM9/3/15
to revie...@googlegroups.com
Hi Steve,

That's not exposed in the API.

Would you mind filing a bug on both of these? We'll see if we can get them fast-tracked for a 2.0.20 release.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - https://www.reviewboard.org

Reply all
Reply to author
Forward
0 new messages