From 5f167085c60a3db9d64f464b43cdd0f054f50895 Mon Sep 17 00:00:00 2001 From: Dylan Huynh Date: Sun, 17 Sep 2023 14:57:02 +1000 Subject: [PATCH 1/2] Updating registration functionality --- config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index dfe0b05..ecb9bab 100644 --- a/config.py +++ b/config.py @@ -14,7 +14,9 @@ class Config(object): FORCE_HTTPS = True SQLALCHEMY_TRACK_MODIFICATIONS = False LOGIN_DISABLED = False # Enable this to avoid having to login - SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') + SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URL") # or other relevant config var + if SQLALCHEMY_DATABASE_URI.startswith("postgres://"): + SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE_URI.replace("postgres://", "postgresql://", 1) SESSION_COOKIE_SECURE = True MAIL_SERVER = os.environ.get('MAIL_SERVER') From a840da7522500c2c9aa0bb73618d44c507992a10 Mon Sep 17 00:00:00 2001 From: Dylan Huynh Date: Sun, 17 Sep 2023 16:11:10 +1000 Subject: [PATCH 2/2] Updated support to CI --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index ecb9bab..8640e93 100644 --- a/config.py +++ b/config.py @@ -15,7 +15,7 @@ class Config(object): SQLALCHEMY_TRACK_MODIFICATIONS = False LOGIN_DISABLED = False # Enable this to avoid having to login SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URL") # or other relevant config var - if SQLALCHEMY_DATABASE_URI.startswith("postgres://"): + if SQLALCHEMY_DATABASE_URI and SQLALCHEMY_DATABASE_URI.startswith("postgres://"): SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE_URI.replace("postgres://", "postgresql://", 1) SESSION_COOKIE_SECURE = True