Skip to content

Commit

Permalink
Fix LookupError in notification loop
Browse files Browse the repository at this point in the history
Signed-off-by: alfred richardsn <rchrdsn@protonmail.ch>
  • Loading branch information
r4rdsn committed Aug 2, 2020
1 parent 549e062 commit 7a1a029
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ async def show_order(

new_edit_msg = None
if invert is None:
user = database_user.get()
try:
user = database_user.get()
except LookupError:
user = await database.users.find_one({"id": user_id})
invert = user.get("invert_order", False)
else:
user = await database.users.find_one_and_update(
Expand Down

0 comments on commit 7a1a029

Please sign in to comment.