From e4706c9082ff6a3165dd43b2d4543f05020702ac Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sun, 11 Oct 2015 21:24:57 +0200 Subject: [PATCH] Fix docs build --- djangocms_installer/share/starting_page.py | 10 +++++----- djangocms_installer/utils.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/djangocms_installer/share/starting_page.py b/djangocms_installer/share/starting_page.py index 2e29e17..1ec6075 100644 --- a/djangocms_installer/share/starting_page.py +++ b/djangocms_installer/share/starting_page.py @@ -4,15 +4,13 @@ import json from distutils.version import LooseVersion -import django -from django.conf import settings -from django.contrib.auth.models import User -from django.utils.translation import ugettext_lazy as _ - def create_pages(): from cms.models import Placeholder from cms.api import create_page, add_plugin, publish_page + from django.conf import settings + from django.contrib.auth.models import User + from django.utils.translation import ugettext_lazy as _ placeholder = {} @@ -58,6 +56,8 @@ def create_pages(): publish_page(page, User.objects.all()[0]) if __name__ == '__main__': + import django + if LooseVersion(django.get_version()) >= LooseVersion('1.7'): django.setup() create_pages() diff --git a/djangocms_installer/utils.py b/djangocms_installer/utils.py index 4136b51..f0b14e5 100644 --- a/djangocms_installer/utils.py +++ b/djangocms_installer/utils.py @@ -14,8 +14,8 @@ def query_yes_no(question, default=None): # pragma: no cover :param question: A string that is presented to the user. :param default: The presumed answer if the user just hits . - It must be "yes" (the default), "no" or None (meaning - an answer is required of the user). + It must be "yes" (the default), "no" or None (meaning + an answer is required of the user). The "answer" return value is one of "yes" or "no".