From 4521a8661922ada3cf30bf25bfa1a05015366516 Mon Sep 17 00:00:00 2001 From: neha7799 Date: Sun, 15 Oct 2023 14:38:09 -0400 Subject: [PATCH] added start_date to user registration data --- application.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application.py b/application.py index b37272c1..6aebd524 100644 --- a/application.py +++ b/application.py @@ -107,8 +107,10 @@ def register(): height = request.form.get('height') target_weight = request.form.get('target_weight') target_date = request.form.get('target_date') + now = datetime.now() + now = now.strftime('%Y-%m-%d') mongo.db.user.insert_one({'name': username, 'email': email, 'pwd': bcrypt.hashpw( - password.encode("utf-8"), bcrypt.gensalt()), 'weight': weight, 'height': height, 'target_weight': target_weight, 'target_date':target_date}) + password.encode("utf-8"), bcrypt.gensalt()), 'weight': weight, 'height': height, 'target_weight': target_weight,'start_date' : now, 'target_date':target_date}) flash(f'Account created for {form.username.data}!', 'success') session['email'] = email return redirect(url_for('dashboard'))