Make sure we can not run initdb against prod or staging.
This commit is contained in:
parent
c338b7d621
commit
dccd833dba
1 changed files with 4 additions and 0 deletions
|
@ -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):
|
||||
|
|
Reference in a new issue