4382: RB2.0 API for review group user deletion not working

satish3
brennie
brennie

What version are you running?

2.0.12

What's the URL of the page containing the problem?

NA

What steps will reproduce the problem?

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:

Unfortunately, this doesn't work:

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

Nor does this:

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

What is the expected output? What do you see instead?

What operating system are you using? What browser?

Please provide any additional information below.

#1 satish3

Any update on this ticket ?

#2 satish3_singh

Can you provide any pointer on this. I will fix it.

brennie
#3 brennie

Hi Satish,

Thanks for reporting this. As it turns out, this is a bug in RB's group resource. It does not provide the correct information for removing users from the groups. Instead, it provides the DELETE links for the actual users, which will only be available to superusers and will not have the result you intend. I'm going to take a stab at this. The fix will end up in the next version of 2.0.x.

  • -New
    +Confirmed
  • +Release-2.0.x
  • +brennie
brennie
#4 brennie

A fix for this has been posted for review at https://reviews.reviewboard.org/r/8449/.

  • -Confirmed
    +PendingReview
#5 satish3_singh

Thanks for the help, but I am getting the below exception:

https://xyz.domain.com/api/groups/xyz/users/

MultipleObjectsReturned at /api/groups/xyz/users/

get() returned more than one Group -- it returned 2!

brennie
#6 brennie

Thanks for reporting that. The first patch has landed and a second patch is up for review at https://reviews.reviewboard.org/r/8458/

#7 satish3_singh

working now. Thanks a lot.

brennie
#8 brennie

This has been fixed in 2.0.x, 2.5.x, and 3.0.x branches of Review Board. It will be released in the next minor release of each.

  • -PendingReview
    +Fixed