this behaves now similar to non-private issues: a page reload is required to update the avatars
:thumbsdown: for me, we don't want to add site admins to the list of issue subscribers, they are not subscribers. They can access the issue but aren't subscribed to it.
This isn't new behavior, site admins already can subscribe to private issues. This PR just enables showing them in the list as requested in https://pagure.io/pagure/issue/3419 . The description there is misleading, admins get subscribed but have now way of checking that.
I have a different fix, what do you think of:
diff --git a/ pagure/lib/__init__.py b/ pagure/lib/__init__.py index a18b2d54..4804a167 100644 --- a/ pagure/lib/__init__.py +++ b/ pagure/lib/__init__.py @@ -4414,13 +4414,13 @@ def get_watch_list(session, obj): if watcher.user.username in users: users.remove(watcher.user.username) - # Add all the people watching this object, remove those who opted-out - for watcher in obj_watchers_query.all(): - if watcher.watch: - users.add(watcher.user.username) - else: - if watcher.user.username in users: - users.remove(watcher.user.username) + # Add all the people watching this object, remove those who opted-out + for watcher in obj_watchers_query.all(): + if watcher.watch: + users.add(watcher.user.username) + else: + if watcher.user.username in users: + users.remove(watcher.user.username)
I like that, much cleaner. non-admins couldn't have seen the private issue and thus couldn't become watchers of it. So there's no need for all those checks here
rebased onto 1022d815cac485fafb8ca4e692d1b9d2c35bd833
We'll need to add some carefully crafted tests for this :)
1 new commit added
add some tests for site admin private issue subscriptions
rebased onto 422e36c71db886229d98c9f56ef0b9d6e274d8a9
Looks good, let's rebase and get it in (looks like there is a commit of mine in there, I guess rebase will remove it)
rebased onto 681a4db1b8292574d8532217823e5f4cf23265af
rebased onto 7650bc6843c6f8c19daf3fa377cbd1f8643c69ef
Commit 19b3268d fixes this pull-request
Pull-Request has been merged by pingou
this behaves now similar to non-private issues: a page reload is required to update the avatars