From b6556439c215284dc06fd9a0309facc4c38be374 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 11 2016 14:56:51 +0000 Subject: If there is no watcher found, retrieve the project from the db This is needed since we then check if the user is watching based on commit rights and/or group membership. --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index c4032ac..76ee859 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -2859,6 +2859,11 @@ def is_watching(session, user, reponame, repouser=None): if watcher: return watcher.watch + + project = pagure.lib.get_project(session, reponame, user=repouser) + if not project: + return False + if user.username == project.user.username: return True