Skip to content

Commit

Permalink
jäveln är fixad
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelambda committed May 5, 2024
1 parent edc81f1 commit a0b0426
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
app = Flask(__name__)
app.config.from_object(config)

app.app_context().push()

db = SQLAlchemy(app)
db.create_all()
with app.app_context():
db = SQLAlchemy(app)
db.create_all()

login_manager = LoginManager(app)
login_manager.login_view = '/login'

from data import PR, User, create_db

# Init user table if it doesn't exist
try:
User.query.all()
except:
print("Data base does not exist, creating a new one")
create_db()
with app.app_context():
try:
User.query.all()
except:
print("Data base does not exist, creating a new one")
create_db()

from users import users_page
app.register_blueprint(users_page)
Expand Down

0 comments on commit a0b0426

Please sign in to comment.