From d8a4fa9bba630260bfa9656bc7fe9a989ccdb913 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sat, 24 Sep 2022 21:59:38 +0000 Subject: [PATCH] Fix a few form-data bugs. --- undercover/routes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/undercover/routes.py b/undercover/routes.py index 8b119ea..1ff8e53 100644 --- a/undercover/routes.py +++ b/undercover/routes.py @@ -96,19 +96,20 @@ def index_get(): user = db.get_user(email) letters = db.get_user_letters(user.id) if len(letters) > 0: - data = json.load(letters[0].contents) # TODO: Load this data more dynamically + data = json.loads(letters[0].contents) + form.company.data = data['company'] form.body.data = data['body'] form.closingText.data = data['closingText'] form.jobAndPronoun.data = data['jobAndPronoun'] form.mySkills.data = data['mySkills'] form.skillTypes.data = data['skillTypes'] - form.username.data = data['uesrname'] + form.username.data = data['username'] return render_template( 'writing.jinja2', - form=CLForm(), + form=form, username=session.get('username') )