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') )