Skip to content

Commit

Permalink
feat(account): improve handling of invalid watchlist responses
Browse files Browse the repository at this point in the history
patrickaod committed Dec 3, 2024
1 parent 17bb6b8 commit daaf495
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -101,8 +101,12 @@ def account(username):
except InvalidId:
# Handle invalid ObjectId
movie_check = False
# Initialise watchlist
watchlist = "yes" if request.form.get("watchlist") else "no"
# Retrieve the watchlist value from the form
watchlist = request.form.get("watchlist")

# Set watchlist based on the value retrieved, default to "no" if not valid
if watchlist not in {"yes", "no"}:
watchlist = "no"

if movie_check:
# Update existing movie

0 comments on commit daaf495

Please sign in to comment.