diff --git a/routes.py b/routes.py index 7617a70..21c8771 100644 --- a/routes.py +++ b/routes.py @@ -45,7 +45,7 @@ def post(): course_ratings[course] = ratings[course] # output in JSON if they request it as such - if request.form['json'] == 'true': + if 'json' in request.form and request.form['json'] == 'true': return json.dumps(course_ratings) # Handle empty search