Refactor/upgrade backend and frontend parts (#2)

* ♻️ Refactor and simplify backend code

* ♻️ Refactor frontend state, integrate typesafe-vuex accessors into state files

* ♻️ Use new state accessors and standardize layout

* 🔒 Upgrade and fix npm security audit

* 🔧 Update local re-generation scripts

* 🔊 Log startup exceptions to detect errors early

* ✏️ Fix password reset token content

* 🔥 Remove unneeded Dockerfile directives

* 🔥 Remove unnecessary print

* 🔥 Remove unnecessary code, upgrade dependencies in backend

* ✏️ Fix typos in docstrings and comments

* 🏗️ Improve user Depends utilities to simplify and remove code

* 🔥 Remove deprecated SQLAlchemy parameter
This commit is contained in:
Sebastián Ramírez
2019-03-11 13:36:42 +04:00
committed by GitHub
parent 9e0b826618
commit cd112bd683
54 changed files with 492 additions and 371 deletions

View File

@@ -1,19 +1,19 @@
from app import crud
from app.core import config
from app.crud import user as crud_user
from app.models.user import UserInCreate
def init_db(db_session):
# Tables should be created with Alembic migrations
# But if you don't want to use migrations, create
# the tables uncommenting the next line
# the tables un-commenting the next line
# Base.metadata.create_all(bind=engine)
user = crud_user.get_by_email(db_session, email=config.FIRST_SUPERUSER)
user = crud.user.get_by_email(db_session, email=config.FIRST_SUPERUSER)
if not user:
user_in = UserInCreate(
email=config.FIRST_SUPERUSER,
password=config.FIRST_SUPERUSER_PASSWORD,
is_superuser=True,
)
user = crud_user.create(db_session, user_in=user_in)
user = crud.user.create(db_session, user_in=user_in)