Skip to content

Commit

Permalink
error handling when modes not exists in database
Browse files Browse the repository at this point in the history
  • Loading branch information
jiji14 committed Dec 16, 2023
1 parent 7e87462 commit cfacb8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emission/core/wrapper/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def getModes(self):
def updateModes(self, updated_mode):
from datetime import datetime
user = get_profile_db().find_one({'user_id': self.uuid})
modes = user['modes']
modes = user['modes'] if 'modes' in user else {}
old_mode = updated_mode['old_mode']
new_mode = updated_mode['new_mode']
is_new_mode_must_added = updated_mode['is_new_mode_must_added']
Expand Down

0 comments on commit cfacb8f

Please sign in to comment.