add --noobserver option to manage.py
[plstackapi.git] / planetstack / scripts / opencloud
old mode 100755 (executable)
new mode 100644 (file)
index ff6eefc..54852b9
@@ -48,7 +48,7 @@ function syncdb {
     python /opt/planetstack/manage.py syncdb --noinput
     if [[ $DJANGO_17 ]]; then
         echo "Loading initial data from fixture..."
-        python /opt/planetstack/manage.py loaddata /opt/planetstack/core/fixtures/initial_data.json
+        python /opt/planetstack/manage.py --noobserver --nomodelpolicy loaddata /opt/planetstack/core/fixtures/initial_data.json
     fi
 }
 function evolvedb {
@@ -134,15 +134,14 @@ if [ "$COMMAND" = "restoredb" ]; then
     createdb
     syncdb
 fi
-if [ "$COMMAND" = "evolvedb" ]; then
+if [ "$COMMAND" = "evolvedb" -o "$COMMAND" = "migratedb" ]; then
     stopserver
     ensure_postgres_running
-    evolvedb
-fi
-if [ "$COMMAND" = "migratedb" ]; then
-    stopserver
-    ensure_postgres_running
-    migratedb
+    if [[ $DJANGO_17 ]]; then
+        migratedb
+    else
+        evolvedb
+    fi
 fi
 if [ "$COMMAND" = "resetdb" ]; then
     stopserver