|
3 | 3 | import logging
|
4 | 4 |
|
5 | 5 | from allauth.socialaccount.models import SocialAccount
|
6 |
| -from celery import chain |
7 | 6 | from django.conf import settings
|
8 | 7 | from django.contrib import messages
|
9 | 8 | from django.contrib.auth.decorators import login_required
|
|
24 | 23 | from vanilla import CreateView, DeleteView, DetailView, GenericView, UpdateView
|
25 | 24 |
|
26 | 25 | from readthedocs.builds.forms import VersionForm
|
27 |
| -from readthedocs.builds.models import Build, Version |
| 26 | +from readthedocs.builds.models import Version |
28 | 27 | from readthedocs.core.mixins import ListViewWithForm, LoginRequiredMixin
|
29 |
| -from readthedocs.core.utils import broadcast, prepare_build, trigger_build |
| 28 | +from readthedocs.core.utils import broadcast, trigger_build, trigger_initial_build |
30 | 29 | from readthedocs.integrations.models import HttpExchange, Integration
|
31 | 30 | from readthedocs.oauth.services import registry
|
32 | 31 | from readthedocs.oauth.tasks import attach_webhook
|
@@ -272,17 +271,7 @@ def done(self, form_list, **kwargs):
|
272 | 271 | )
|
273 | 272 |
|
274 | 273 | def trigger_initial_build(self, project):
|
275 |
| - """Trigger initial build.""" |
276 |
| - update_docs, build = prepare_build(project) |
277 |
| - if (update_docs, build) == (None, None): |
278 |
| - return None |
279 |
| - |
280 |
| - task_promise = chain( |
281 |
| - attach_webhook.si(project.pk, self.request.user.pk), |
282 |
| - update_docs, |
283 |
| - ) |
284 |
| - async_result = task_promise.apply_async() |
285 |
| - return async_result |
| 274 | + return trigger_initial_build(project, self.request.user) |
286 | 275 |
|
287 | 276 | def is_advanced(self):
|
288 | 277 | """Determine if the user selected the `show advanced` field."""
|
|
0 commit comments