mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
Limit search by recipient to 50 results
Things could get ugly if you use a short search string on a service with lots of notifications…
This commit is contained in:
@@ -633,7 +633,11 @@ def dao_get_notifications_by_recipient_or_reference(service_id, search_term, not
|
||||
if notification_type:
|
||||
filters.append(Notification.notification_type == notification_type)
|
||||
|
||||
results = db.session.query(Notification).filter(*filters).order_by(desc(Notification.created_at)).all()
|
||||
results = db.session.query(Notification)\
|
||||
.filter(*filters)\
|
||||
.order_by(desc(Notification.created_at))\
|
||||
.limit(current_app.config['PAGE_SIZE'])\
|
||||
.all()
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user