You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sending a request with the filter set to empty object (filter={}) causes the server to error and return a 500 error. Although best practice in the front end should be to not set this property if filters aren't applied - it probably shouldn't break the API either.
Traceback (most recent call last):
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask_restful\__init__.py", line 269, in error_router
return original_handler(e)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask_restful\__init__.py", line 269, in error_router
return original_handler(e)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask_restful\__init__.py", line 458, in wrapper
resp = resource(*args, **kwargs)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask\views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "C:\Users\mnf98541\anaconda3\lib\site-packages\flask_restful\__init__.py", line 573, in dispatch_request
resp = meth(*args, **kwargs)
File "C:\code\datagateway-api\common\helpers.py", line 34, in wrapper_requires_session
return method(*args, **kwargs)
File "C:\code\datagateway-api\common\helpers.py", line 54, in wrapper_gets_records
return method(*args, **kwargs)
File "C:\code\datagateway-api\src\resources\entities\investigations_endpoints.py", line 14, in get
return get_rows_by_filter(INVESTIGATION, get_filters_from_query_string()), 200
File "C:\code\datagateway-api\common\database_helpers.py", line 127, in get_rows_by_filter
if list(filter)[0].lower() == "where":
IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
@keiranjprice101 In my opinion unfiltered get all - an empty set of filters is valid in the sense that we're asking for data with explicitly no filters applied. Essentially, ?filter={} should be ignored and treated the same not having a filter param at all
Sending a request with the filter set to empty object (
filter={}
) causes the server to error and return a 500 error. Although best practice in the front end should be to not set this property if filters aren't applied - it probably shouldn't break the API either.The text was updated successfully, but these errors were encountered: