Oben wird man gebittet sich anzumelden wenn man nicht angemeldet ist. ansonsten wird man mit seinem Namen gegrüßt.

This commit is contained in:
janphilippweinsheimer 2024-01-23 10:22:16 +01:00
parent 48bae38872
commit 5b633c8f42

10
app.py
View File

@ -35,12 +35,15 @@ def index():
if current_user.is_authenticated:
habits = current_user.get_habits()
name = "Hallo " + current_user.name
else:
habits = []
name = "Bitte melde dich an."
# habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")]
return render_template(
'index.html',
title=name,
utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M %A"),
habits=habits,
errors={},
@ -221,13 +224,6 @@ def habit_create():
errors=errors,
)
@app.route('/test1')
def test1():
return render_template('layouts/indextest1.html', errors={})
@app.route('/test2')
def test2():
return render_template('layouts/indextest2.html', errors={})
# Run the application
if __name__ == '__main__':