1. Justin Venezuela
  2. noted

Commits

Justin Venezuela  committed f81bee6

Logout and notes redirect to home if not logged in.

  • Participants
  • Parent commits 52981d0
  • Branches default

Comments (0)

Files changed (1)

File src/routes.py

View file
 def logout():
   # Make sure user is already logged in.
   if g.user is None:
-    return 'You are not logged in.'
+    return redirect(url_for('home'))
   else:
     # Log him out.
     session.pop('user_id')
 def notes():
   # Make sure user is already logged in.
   if g.user is None:
-    return 'You are not logged in.'
+    return redirect(url_for('home'))
   elif request.method == 'GET':
     # Get user's notes.
     notes = g.user.notes