fix: prevent crash when page < 1
parent
2861f721af
commit
e827a3355e
|
@ -323,4 +323,7 @@ def get_reports(
|
|||
if report_activity is not None:
|
||||
query = query.filter(Report.report_activity == report_activity.name
|
||||
)
|
||||
page = page - 1
|
||||
if page < 1:
|
||||
page = 1
|
||||
return query.order_by(Report.created.desc()).offset(10 * (page - 1)).limit(10).all()
|
||||
|
|
Loading…
Reference in New Issue