def trigger_initial_build(self, project): """Trigger initial build.""" update_docs = prepare_build(project) task_promise = chain( attach_webhook.si(project.pk, self.request.user.pk), update_docs, ) async_result = task_promise.apply_async() return async_result
def trigger_initial_build(self, project, user): """ Trigger initial build after project is imported. :param project: project's documentation to be built :returns: Celery AsyncResult promise """ update_docs, build = prepare_build(project) if (update_docs, build) == (None, None): return None from readthedocs.oauth.tasks import attach_webhook task_promise = chain( attach_webhook.si(project.pk, user.pk), update_docs, ) async_result = task_promise.apply_async() return async_result