diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index c27dc0e9fc6..04d6d681b11 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """Project views for authenticated users.""" import logging @@ -58,9 +56,9 @@ ProjectRelationship, WebHook, ) +from readthedocs.projects.notifications import EmailConfirmNotification from readthedocs.projects.signals import project_import from readthedocs.projects.views.base import ProjectAdminMixin, ProjectSpamMixin -from readthedocs.projects.notifications import EmailConfirmNotification from ..tasks import retry_domain_verification @@ -354,7 +352,7 @@ def get(self, request, *args, **kwargs): if form.is_valid(): project = form.save() project.save() - trigger_build(project) + self.trigger_initial_build(project) messages.success( request, _('Your demo project is currently being imported'), @@ -381,6 +379,14 @@ def get_form_kwargs(self): """Form kwargs passed in during instantiation.""" return {'user': self.request.user} + def trigger_initial_build(self, project): + """ + Trigger initial build. + + Allow to override the behavior from outside. + """ + return trigger_build(project) + class ImportView(PrivateViewMixin, TemplateView):