You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sudo should be remembered for SaveMixin objects #532
I would expect this to change the notification level for the sudo'd user.
Actual Behavior
When I call notif.save(), it has seemingly no effect, because I am missing sudo.
Instead, the changes were applied to my admin account!
Changing the code to notif.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 using sudo=user, perhaps the library can attach that sudo user to the SaveMixin object, and automatically apply it when .save() is called without arguments.
I consider this a bug, and I can't imagine that anyone is actually relying on the current behavior.
I agree that this is an unexpected behaviour. I'm still trying to find the proper way to handle this in the code but I'll come up with something (not in the 1.5.0 release though).
I'm not sure if I agree with the premise of this issue. As python-gitlab is a wrapper around the GitLab API. I'm not sure that I think it should be making decisions to save the sudo state. But that is just my opinion.
Also this issue was opened over six years ago and nobody has felt motivated enough to do the work to create a PR to close this issue, which makes me think this should be closed.
Activity
gpocentek commentedon Jun 22, 2018
Hi @JonathonReinhart
I agree that this is an unexpected behaviour. I'm still trying to find the proper way to handle this in the code but I'll come up with something (not in the 1.5.0 release though).
github-actions commentedon Jul 12, 2024
This issue was closed because it has been marked stale for 15 days with no activity. If this issue is still valid, please re-open.
JonathonReinhart commentedon Jul 12, 2024
I believe this is still appropriate.
JohnVillalovos commentedon Jul 13, 2024
I'm not sure if I agree with the premise of this issue. As python-gitlab is a wrapper around the GitLab API. I'm not sure that I think it should be making decisions to save the
sudostate. But that is just my opinion.Also this issue was opened over six years ago and nobody has felt motivated enough to do the work to create a PR to close this issue, which makes me think this should be closed.
docs: document how to use `sudo` if modifying an object
docs: document how to use `sudo` if modifying an object
docs: document how to use `sudo` if modifying an object
docs: document how to use `sudo` if modifying an object
docs: document how to use `sudo` if modifying an object
docs: document how to use `sudo` if modifying an object