IsaacCheng9 / student-network

A social media platform for university students with a social feed, quizzes, and achievements. Developed with Flask.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix KeyError when accessing feed, stats, games, and chat without logging in

IsaacCheng9 opened this issue · comments

Problem Statement

  • When accessing feed, stats (leaderboard, achievements), games (quizzes, flashcards), or chat without logging in, a KeyError: 'username' occurs.
    • This can be fixed by implementing the @login_required annotation with Flask, and hiding these items from the navigation bar when the user isn't logged in.
      • It may be better to hide the navigation bar entirely when the user isn't logged in.