diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 857d6bf..2b3eb65 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -3259,13 +3259,7 @@ def is_watching_obj(session, user, obj): if not user: return False - if obj.user.user == user.user: - return True - - for comment in obj.comments: - if comment.user.user == user.user: - return True - + # First check if the user explicitely turned on/off notifications if obj.isa == "issue": query = session.query( model.IssueWatcher @@ -3288,6 +3282,14 @@ def is_watching_obj(session, user, obj): if watcher: return watcher.watch + # Otherwise, just check if they are in the default group + if obj.user.user == user.user: + return True + + for comment in obj.comments: + if comment.user.user == user.user: + return True + return False