fix 500 error

pull/147/head
Aevann 2023-05-09 21:39:56 +03:00
parent 23af2576c8
commit e990cf4a62
1 changed files with 4 additions and 2 deletions

View File

@ -338,9 +338,11 @@ def searchmessages(v:User):
if 'sentto' in criteria:
sentto = criteria['sentto']
try: sentto = get_user(sentto, graceful=True)
except:
sentto = get_user(sentto, graceful=True)
if not sentto:
abort(400, "The `sentto` field must contain a user's username!")
comments = comments.filter(Comment.sentto == sentto.id)
total = comments.count()