From 60b4f1867161436906f30427120de5b3a316665c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 06 2018 13:10:39 +0000 Subject: Refresh the PR cache of the parent repo rather than always the current one If the current project is a fork, we want to refresh the cache of the main project and otherwise, we fall back to refreshing the cache of the current project. Fixes https://pagure.io/pagure/issue/2940 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/files/default_hook.py b/pagure/hooks/files/default_hook.py index 2ff0bed..868e4aa 100755 --- a/pagure/hooks/files/default_hook.py +++ b/pagure/hooks/files/default_hook.py @@ -128,7 +128,12 @@ def run_as_post_receive_hook(): print() # Schedule refresh of all opened PRs - pagure.lib.tasks.refresh_pr_cache.delay(project.name, namespace, username) + parent = project.parent or project + pagure.lib.tasks.refresh_pr_cache.delay( + parent.name, + parent.namespace, + parent.user.user if parent.is_fork else None + ) pagure.SESSION.remove()