Skip to content

Commit

Permalink
Raise a clearer error if the sites app is missing. Closes #154.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Feb 27, 2015
1 parent 6575e60 commit 110c0cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions forms_builder/forms/settings.py
@@ -1,6 +1,12 @@
from __future__ import unicode_literals

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured


if not (getattr(settings, "SITE_ID") and
"django.contrib.sites" in settings.INSTALLED_APPS):
raise ImproperlyConfigured("django.contrib.sites is required")


# The maximum allowed length for field values.
Expand All @@ -22,8 +28,7 @@
USE_HTML5 = getattr(settings, "FORMS_BUILDER_USE_HTML5", True)

# Boolean controlling whether forms are associated to Django's Sites framework.
USE_SITES = getattr(settings, "FORMS_BUILDER_USE_SITES",
"django.contrib.sites" in settings.INSTALLED_APPS)
USE_SITES = getattr(settings, "FORMS_BUILDER_USE_SITES", False)

# Boolean controlling whether form slugs are editable in the admin.
EDITABLE_SLUGS = getattr(settings, "FORMS_BUILDER_EDITABLE_SLUGS", False)
Expand Down

0 comments on commit 110c0cc

Please sign in to comment.