With this people with the appropriate API token will be able to adjust their own watch status and instance-wide admins will be able to do it for any user.
Fixes https://pagure.io/pagure/issue/3205 Fixes https://pagure.io/pagure/issue/3174
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr
rebased onto f7333c9e3b9ff4b960654d293e5fc23c0a38cbd0
rebased onto 6e1b1fb1dcdebca33b63ffed3c0b3eb9a1583c23
Maybe we could use status and user here, I feel that watch_status and user_watching is a little bit redundant, since the endpoint name is giving the needed context.
status
user
watch_status
user_watching
should it be 3 here ? :)
should this be check just after line 94 ?
should we raise an invalid request exception here if watch_status is None ?
A few comments but looks good. Oh and some tests are failing :P
Agreed, but I wanted to distinguish the user whose watch status is being changed vs the username of the user who forked the project and I felt like having two fields: user and username may be too close to each other
Quite possibly:)
We could
pagure.lib.update_watch_status() takes care of that for us :) (avoids duplicating code)
pagure.lib.update_watch_status()
oh yes, that's a valid point, since the api endpoint is watchers/update maybe watcher would work ? but feel free to keep it as it is :)
watchers/update
watcher
+1
watcher and status it is :)
rebased onto acaf1443b65a26ede58f130c6988ad067dda9eba
LGTM :)
rebased onto 78dff61a320fb79b14d5e790c3815daabdb3470e
Jenkins caught an typo :)
rebased onto 12748fcd30ab84fbb9269cf8d781ad2928d4fc92
rebased onto f778bdca1a086b21c99890d75e97a420ce2036d2
Pretty please pagure-ci rebuild
Thanks for the review :)
Pull-Request has been merged by pingou
With this people with the appropriate API token will be able to adjust
their own watch status and instance-wide admins will be able to do it
for any user.
Fixes https://pagure.io/pagure/issue/3205
Fixes https://pagure.io/pagure/issue/3174
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr