Project

General

Profile

Actions

Bug #7738

closed

Error in reports blueprint when page is not a valid number

Added by Rajmund Hruška 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
Development - GUI
Target version:
Start date:
05/14/2024
Due date:
% Done:

0%

Estimated time:
To be discussed:
No

Description

Might be an issue in other places where pagination is used.

Message type: CRITICAL
Location:     /var/mentat/venv/lib/python3.11/site-packages/hawat/base.py:202
Module:       base
Function:     eh_internal_server_error
Time:         2024-05-14 20:09:31,613

Message:

INTERNAL SERVER ERROR

Request: /reports/search?label=&dt_from=2024-05-07+21:00&dt_to=2024-05-14+21:00&submit=Search&page=2d
Traceback:
Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.11/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/hawat/view/__init__.py", line 872, in dispatch_request
    form = self.get_search_form(flask.request.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/hawat/blueprints/reports/__init__.py", line 130, in get_search_form
    return EventReportSearchForm(request_args, meta={'csrf': False})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/wtforms/form.py", line 208, in __call__
    return type.__call__(cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mentat/venv/lib/python3.11/site-packages/flask_wtf/form.py", line 73, in __init__
    super().__init__(formdata=formdata, **kwargs)
  File "/var/mentat/venv/lib/python3.11/site-packages/wtforms/form.py", line 286, in __init__
    self.process(formdata, obj, data=data, **kwargs)
  File "/var/mentat/venv/lib/python3.11/site-packages/wtforms/form.py", line 127, in process
    field.process(formdata, data, extra_filters=field_extra_filters)
  File "/var/mentat/venv/lib/python3.11/site-packages/wtforms/fields/core.py", line 338, in process
    self.data = filter(self.data)
                ^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Actions

Also available in: Atom PDF