From f2e9849337211c91cfc33a1c07d3dcf4b76da077 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Sat, 3 Oct 2015 19:50:24 +0000 Subject: [PATCH] Fixes on deployment --- orchestra/contrib/saas/validators.py | 14 ++++++++++++++ scripts/containers/deploy.sh | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 orchestra/contrib/saas/validators.py diff --git a/orchestra/contrib/saas/validators.py b/orchestra/contrib/saas/validators.py new file mode 100644 index 00000000..ed9c7287 --- /dev/null +++ b/orchestra/contrib/saas/validators.py @@ -0,0 +1,14 @@ +from django.core.exceptions import ValidationError +from django.utils.translation import ugettext_lazy as _ + +from orchestra.utils.apps import isinstalled + + +def validate_website_saas_directives(app): + def validator(enabled, app=app): + if enabled and isinstalled('orchestra.contrib.websites'): + from orchestra.contrib.websites import settings + if app not in settings.WEBSITES_SAAS_DIRECTIVES: + raise ValidationError(_("Allow custom URL is enabled for '%s', " + "but has no associated WEBSITES_SAAS_DIRECTIVES" % app)) + return validator diff --git a/scripts/containers/deploy.sh b/scripts/containers/deploy.sh index 6b5a9e93..3b985981 100644 --- a/scripts/containers/deploy.sh +++ b/scripts/containers/deploy.sh @@ -253,6 +253,8 @@ function main () { install_orchestra "$dev" $home $repo if [[ ! -e $project_name ]]; then surun "orchestra-admin startproject $project_name" + else + echo "Not deploying, $project_name already exists." fi cd $project_name setup_database "$dev" "$noinput"