Make sure we can not run initdb against prod or staging.

This commit is contained in:
Jake Moshenko 2014-07-07 15:35:29 -04:00
parent c338b7d621
commit dccd833dba

View file

@ -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):