Skip to content

Commit

Permalink
added start_date to user registration data
Browse files Browse the repository at this point in the history
  • Loading branch information
neha7799 committed Oct 15, 2023
1 parent 779e0cb commit 4521a86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 4521a86

Please sign in to comment.