forked from rDrama/rDrama
fix 500 error
parent
23af2576c8
commit
e990cf4a62
|
@ -338,9 +338,11 @@ def searchmessages(v:User):
|
||||||
|
|
||||||
if 'sentto' in criteria:
|
if 'sentto' in criteria:
|
||||||
sentto = criteria['sentto']
|
sentto = criteria['sentto']
|
||||||
try: sentto = get_user(sentto, graceful=True)
|
sentto = get_user(sentto, graceful=True)
|
||||||
except:
|
|
||||||
|
if not sentto:
|
||||||
abort(400, "The `sentto` field must contain a user's username!")
|
abort(400, "The `sentto` field must contain a user's username!")
|
||||||
|
|
||||||
comments = comments.filter(Comment.sentto == sentto.id)
|
comments = comments.filter(Comment.sentto == sentto.id)
|
||||||
|
|
||||||
total = comments.count()
|
total = comments.count()
|
||||||
|
|
Loading…
Reference in New Issue