Skip to content

fix(scenarios): Handle non-numeric 'set' query parameter gracefully - #16

Merged
SushantGautam merged 1 commit into
mainfrom
seer/fix/scenarios-set-param-validation
Oct 6, 2026
Merged

SushantGautam merged 1 commit into
mainfrom
seer/fix/scenarios-set-param-validation

Conversation

@sentry

@sentry sentry Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The /scenarios/ page previously crashed with a ValueError (resulting in a 500 error) if the set query parameter in the URL was not a valid integer (e.g., ?set=4%5C). This occurred because the value was passed directly to ScenarioSet.objects.filter(pk=...) without prior validation.

This change introduces a check to ensure that the set parameter is numeric (isdigit()) before attempting to use it for a primary key lookup. If the parameter is not a valid number, the selected scenario set will remain None, causing the page to render the list of all scenario sets instead of crashing. This approach mirrors the existing validation logic for the version query parameter.

Fixes SIMPLEAUDITSTUDIO-2H

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
@SushantGautam
SushantGautam merged commit 721396e into main Oct 6, 2026
1 check passed
@SushantGautam
SushantGautam deleted the seer/fix/scenarios-set-param-validation branch October 6, 2026 22:42
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