Skip to content
Snippets Groups Projects
Commit 222761b1 authored by OndraRehounek's avatar OndraRehounek Committed by jan.bednarik
Browse files

Refactor jekyll import to Class

parent 657e3a7c
No related branches found
No related tags found
2 merge requests!442Release,!432Feature/majak imports
......@@ -3,7 +3,7 @@ from django.contrib.messages import ERROR, WARNING
from wagtail.admin.forms import WagtailAdminPageForm
from wagtail.core.models.collections import Collection
from .jekyll_import import perform_import
from .jekyll_import import JekyllArticleImporter
class JekyllImportForm(WagtailAdminPageForm):
......@@ -72,13 +72,14 @@ class JekyllImportForm(WagtailAdminPageForm):
return cleaned_data
def handle_import(self):
import_message_list = perform_import(
import_message_list = JekyllArticleImporter(
article_parent_page=self.instance,
collection=self.cleaned_data["collection"],
url=self.cleaned_data["jekyll_repo_url"],
dry_run=self.cleaned_data["dry_run"],
use_git=self.cleaned_data["use_git"],
)
).perform_import()
self.instance.import_message_list = import_message_list
return import_message_list
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment