Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid ints in search queries #1846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alastair
Copy link
Member

Issue(s)
Fixes https://logserver.mtg.upf.edu/organizations/sentry/issues/3819/

I'm not sure if we need extra code to remove None values from the parameter list

Description

ValueError: invalid literal for int() with base 10: '1\'"'
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "geotags/views.py", line 277, in for_query
    'query_description': SearchQueryProcessor(request).get_textual_description(),
  File "utils/search/search_query_processor.py", line 251, in __init__
    option.load_value()
  File "utils/search/search_query_processor_options.py", line 95, in load_value
    value_from_request = self.get_value_from_request()
  File "utils/search/search_query_processor_options.py", line 226, in get_value_from_request
    return int(self.request.GET.get(self.query_param_name))

@alastair
Copy link
Member Author

todo: test for this query parameter
todo: also implement these checks in forum search: similar bug where someone tried to pass in a null to the forum name: https://logserver.mtg.upf.edu/organizations/sentry/issues/3817/?alert_rule_id=32&alert_type=issue&notification_uuid=ef3b6713-2c47-4c11-ba86-17d8fb3e76b5&project=3&referrer=slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant