diff --git a/pagure/hooks/pagure_ci.py b/pagure/hooks/pagure_ci.py index 691b1f8..ecf15de 100644 --- a/pagure/hooks/pagure_ci.py +++ b/pagure/hooks/pagure_ci.py @@ -149,8 +149,7 @@ class PagureCi(BaseHook): form = PagureCiForm db_object = PagureCITable backref = 'ci_hook' - form_fields = ['ci_type', 'ci_url', 'ci_job', 'active_commit', 'active_pr', - 'active'] + form_fields = ['ci_type', 'ci_url', 'ci_job', 'active_commit', 'active_pr'] @classmethod def set_up(cls, project): diff --git a/pagure/ui/plugins.py b/pagure/ui/plugins.py index bc0207a..656e125 100644 --- a/pagure/ui/plugins.py +++ b/pagure/ui/plugins.py @@ -132,6 +132,12 @@ def view_plugin(repo, plugin, username=None, namespace=None, full=True): form=form, fields=fields) + # Compute the ci_hook active value in function + # of the active PR and active commit values. + if form.active_pr and form.active_commit: + if form.active_pr.data or form.active_commit.data: + form.active.data = True + if form.active.data: # Set up the main script if necessary plugin.set_up(repo)