do not use RESET_DB to avoid potential error: uncomment fake_date locally if necessary

This commit is contained in:
Son NK 2019-12-06 10:20:46 +01:00
parent a5615b22e7
commit 6e387444f5
2 changed files with 4 additions and 6 deletions

View File

@ -50,7 +50,6 @@ EMAIL_SERVERS_WITH_PRIORITY = eval(
EMAIL_SERVERS = [es for _, es in EMAIL_SERVERS_WITH_PRIORITY]
# Database
RESET_DB = "RESET_DB" in os.environ
DB_URI = os.environ["DB_URI"]
# Flask secret

View File

@ -19,7 +19,6 @@ from app.config import (
ENABLE_SENTRY,
URL,
SHA1,
RESET_DB,
PADDLE_MONTHLY_PRODUCT_ID,
)
from app.dashboard.base import dashboard_bp
@ -379,10 +378,10 @@ if __name__ == "__main__":
# enable to print all queries generated by sqlalchemy
# app.config["SQLALCHEMY_ECHO"] = True
if RESET_DB:
LOG.d("reset db, add fake data")
with app.app_context():
fake_data()
# warning: only used in local
# LOG.d("reset db, add fake data")
# with app.app_context():
# fake_data()
if URL.startswith("https"):
LOG.d("enable https")