From a1a721b1c2074c3be1506e03e12761666d2125c8 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Thu, 1 Oct 2015 19:08:34 +0000 Subject: [PATCH] Fixes on deployment --- orchestra/management/commands/setuppostgres.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orchestra/management/commands/setuppostgres.py b/orchestra/management/commands/setuppostgres.py index 59e7d12b..97e8e89b 100644 --- a/orchestra/management/commands/setuppostgres.py +++ b/orchestra/management/commands/setuppostgres.py @@ -43,7 +43,9 @@ class Command(BaseCommand): } run(textwrap.dedent("""\ - su postgres -c "psql -c \\"CREATE USER %(db_user)s PASSWORD '%(db_password)s';\\"" + su postgres -c "psql -c \\"CREATE USER %(db_user)s PASSWORD '%(db_password)s';\\"" || { + su postgres -c "psql -c \\"ALTER USER %(db_user)s WITH PASSWORD '%(db_password)s';\\"" + } su postgres -c "psql -c \\"CREATE DATABASE %(db_name)s OWNER %(db_user)s;\\""\ """) % context, valid_codes=(0,1) )