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"