Skip to content

Commit

Permalink
fix: handle invalid page numbers (#2313)
Browse files Browse the repository at this point in the history
  • Loading branch information
cquintana92 authored Nov 8, 2024
1 parent 813de9d commit 8ba75be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/dashboard/views/alias_contact_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down
5 changes: 4 additions & 1 deletion app/dashboard/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
5 changes: 4 additions & 1 deletion app/dashboard/views/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ba75be

Please sign in to comment.