add table detection logic
This commit is contained in:
13
app/app.py
13
app/app.py
@@ -84,6 +84,19 @@ def podStatus():
|
||||
# Index route
|
||||
@app.route('/')
|
||||
def index():
|
||||
# Check for empty database, go to setup page if not setup
|
||||
global tablesSetup
|
||||
required_tables = ['period', 'task', 'event', 'user']
|
||||
for table in required_tables:
|
||||
if table in db.metadata.tables:
|
||||
tablesSetup = True
|
||||
else:
|
||||
tablesSetup = False
|
||||
break
|
||||
if not tablesSetup:
|
||||
return ""
|
||||
# Otherwise, redirect to /events
|
||||
else:
|
||||
return redirect('/events')
|
||||
|
||||
# Authentication routes
|
||||
|
Reference in New Issue
Block a user