- Notifications
You must be signed in to change notification settings - Fork673
Closed
Description
Description of the problem, including code/CLI snippet
grp=gl.groups.get('example-group')notif=grp.notificationsettings.get(sudo=otheruser)print("Old level:",notif.level)notif.level=gitlab.const.NOTIFICATION_LEVEL_GLOBALnotif.save()# missing sudo=otherusernotif=grp.notificationsettings.get(sudo=otheruser)print("New level:",notif.level)
Expected Behavior
I would expect this to change the notification level for the sudo'd user.
Actual Behavior
When I callnotif.save()
, it has seemingly no effect, because I am missingsudo
.
Instead, the changes were appliedto my admin account!
Changing the code tonotif.save(sudo=otheruser)
works as expected.
Specifications
- python-gitlab version:1.4.0
- API version you are using (v3/v4):v4
- Gitlab server version (or gitlab.com):10.6.4
Proposal
If an object is acquired usingsudo=user
, perhaps the library canattach thatsudo
user to theSaveMixin
object, and automatically apply it when.save()
is called without arguments.
I consider this a bug, and I can't imagine that anyone isactually relying on the current behavior.