Skip to content

Commit

Permalink
Changes | Utsav
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsav Lal committed Sep 17, 2023
1 parent fc1ce4c commit 055fb36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion insert_food_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

for i in range(1, len(l)):
temp = l[i].split(",")
mongo.db.food.insert({'food': temp[0], 'calories': temp[1]})
mongo.db.food.insert_one({'food': temp[0], 'calories': temp[1]})
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bcrypt==3.2.0
bcrypt==4.0.1
blinker==1.4
bson==0.5.10
certifi==1.0.1
Expand All @@ -19,7 +19,7 @@ Jinja2==3.0.1
jwt==1.2.0
MarkupSafe==2.0.1
pycparser==2.20
pymongo==3.11.3
pymongo==4.5.0
python-dateutil==2.8.2
six==1.16.0
tabulate==0.8.9
Expand Down
6 changes: 3 additions & 3 deletions tests/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def register():
username = request.form.get('username')
email = request.form.get('email')
password = request.form.get('password')
mongo.db.user.insert({'name': username, 'email': email, 'pwd': bcrypt.hashpw(
mongo.db.user.insert_one({'name': username, 'email': email, 'pwd': bcrypt.hashpw(
password.encode("utf-8"), bcrypt.gensalt())})
flash(f'Account created for {form.username.data}!', 'success')
return redirect(url_for('home'))
Expand Down Expand Up @@ -168,13 +168,13 @@ def user_profile():
temp = mongo.db.profile.find_one({'email': email}, {
'height', 'weight', 'goal', 'target_weight'})
if temp is not None:
mongo.db.profile.update({'email': email},
mongo.db.profile.update_one({'email': email},
{'$set': {'weight': temp['weight'],
'height': temp['height'],
'goal': temp['goal'],
'target_weight': temp['target_weight']}})
else:
mongo.db.profile.insert({'email': email,
mongo.db.profile.insert_one({'email': email,
'height': height,
'weight': weight,
'goal': goal,
Expand Down

0 comments on commit 055fb36

Please sign in to comment.