From dccd833dbaceec0a00e3bdf55215c3a0a69daf96 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Mon, 7 Jul 2014 15:35:29 -0400 Subject: [PATCH] Make sure we can not run initdb against prod or staging. --- initdb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/initdb.py b/initdb.py index 456587220..c81e148f3 100644 --- a/initdb.py +++ b/initdb.py @@ -508,6 +508,10 @@ def populate_database(): if __name__ == '__main__': log_level = getattr(logging, app.config['LOGGING_LEVEL']) logging.basicConfig(level=log_level) + + if not isinstance(model.db.obj, SqliteDatabase): + raise RuntimeError('Attempted to initialize production database!') + initialize_database() if app.config.get('POPULATE_DB_TEST_DATA', False):