fix: handle invalid page numbers (#2313)

This commit is contained in:
Carlos Quintana 2024-11-08 15:16:09 +01:00 committed by GitHub
parent 813de9d40b
commit 8ba75befa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 deletions

View file

@ -227,7 +227,10 @@ def alias_contact_manager(alias_id):
page = 0
if request.args.get("page"):
page = int(request.args.get("page"))
try:
page = int(request.args.get("page"))
except ValueError:
pass
query = request.args.get("query") or ""

View file

@ -71,7 +71,10 @@ def index():
page = 0
if request.args.get("page"):
page = int(request.args.get("page"))
try:
page = int(request.args.get("page"))
except ValueError:
pass
highlight_alias_id = None
if request.args.get("highlight_alias_id"):

View file

@ -43,7 +43,10 @@ def notification_route(notification_id):
def notifications_route():
page = 0
if request.args.get("page"):
page = int(request.args.get("page"))
try:
page = int(request.args.get("page"))
except ValueError:
pass
notifications = (
Notification.filter_by(user_id=current_user.id)