From 67f7d160d4f3b889d2f20e9630482790a75b5259 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 26 Nov 2025 11:45:59 -0500 Subject: [PATCH] Tasks: remove user_pk from task calls --- readthedocs/projects/views/mixins.py | 4 +--- readthedocs/projects/views/private.py | 10 +--------- readthedocs/rtd_tests/tests/test_project_views.py | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/readthedocs/projects/views/mixins.py b/readthedocs/projects/views/mixins.py index 1c44864e120..df54fa7bdc7 100644 --- a/readthedocs/projects/views/mixins.py +++ b/readthedocs/projects/views/mixins.py @@ -137,9 +137,7 @@ def trigger_initial_build(self, project, user): from readthedocs.oauth.tasks import attach_webhook task_promise = chain( - # TODO: Remove user_pk on the next release, - # it's used just to keep backward compatibility with the old task signature. - attach_webhook.si(project.pk, user.pk), + attach_webhook.si(project.pk), update_docs, ) async_result = task_promise.apply_async() diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index 8ecc6955857..99c8725abdf 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -945,9 +945,6 @@ def form_valid(self, form): attach_webhook( project_pk=self.get_project().pk, integration=self.object, - # TODO: Remove user_pk on the next release, - # it's used just to keep backward compatibility with the old task signature. - user_pk=None, ) return HttpResponseRedirect(self.get_success_url()) @@ -1016,12 +1013,7 @@ def post(self, request, *args, **kwargs): # This is a brute force form of the webhook sync, if a project has a # webhook or a remote repository object, the user should be using # the per-integration sync instead. - attach_webhook( - project_pk=self.get_project().pk, - # TODO: Remove user_pk on the next release, - # it's used just to keep backward compatibility with the old task signature. - user_pk=None, - ) + attach_webhook(project_pk=self.get_project().pk) return HttpResponseRedirect(self.get_success_url()) def get_success_url(self): diff --git a/readthedocs/rtd_tests/tests/test_project_views.py b/readthedocs/rtd_tests/tests/test_project_views.py index 26a94074cba..63de7cb3a40 100644 --- a/readthedocs/rtd_tests/tests/test_project_views.py +++ b/readthedocs/rtd_tests/tests/test_project_views.py @@ -469,7 +469,6 @@ def test_integration_create(self, attach_webhook): attach_webhook.assert_called_once_with( project_pk=self.project.pk, integration=integration.first(), - user_pk=None, ) @mock.patch("readthedocs.projects.views.private.attach_webhook")