Skip to content

Commit 7a9b050

Browse files
authored
Tasks: remove user_pk from task calls (#12610)
After this change is deployed, we should be able to remove user_pk from the signature
1 parent f6d87eb commit 7a9b050

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

readthedocs/projects/views/mixins.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def trigger_initial_build(self, project, user):
137137
from readthedocs.oauth.tasks import attach_webhook
138138

139139
task_promise = chain(
140-
# TODO: Remove user_pk on the next release,
141-
# it's used just to keep backward compatibility with the old task signature.
142-
attach_webhook.si(project.pk, user.pk),
140+
attach_webhook.si(project.pk),
143141
update_docs,
144142
)
145143
async_result = task_promise.apply_async()

readthedocs/projects/views/private.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -945,9 +945,6 @@ def form_valid(self, form):
945945
attach_webhook(
946946
project_pk=self.get_project().pk,
947947
integration=self.object,
948-
# TODO: Remove user_pk on the next release,
949-
# it's used just to keep backward compatibility with the old task signature.
950-
user_pk=None,
951948
)
952949
return HttpResponseRedirect(self.get_success_url())
953950

@@ -1016,12 +1013,7 @@ def post(self, request, *args, **kwargs):
10161013
# This is a brute force form of the webhook sync, if a project has a
10171014
# webhook or a remote repository object, the user should be using
10181015
# the per-integration sync instead.
1019-
attach_webhook(
1020-
project_pk=self.get_project().pk,
1021-
# TODO: Remove user_pk on the next release,
1022-
# it's used just to keep backward compatibility with the old task signature.
1023-
user_pk=None,
1024-
)
1016+
attach_webhook(project_pk=self.get_project().pk)
10251017
return HttpResponseRedirect(self.get_success_url())
10261018

10271019
def get_success_url(self):

readthedocs/rtd_tests/tests/test_project_views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ def test_integration_create(self, attach_webhook):
469469
attach_webhook.assert_called_once_with(
470470
project_pk=self.project.pk,
471471
integration=integration.first(),
472-
user_pk=None,
473472
)
474473

475474
@mock.patch("readthedocs.projects.views.private.attach_webhook")

0 commit comments

Comments
 (0)