Skip to content

API crash on /api/v1/projects/ with non-numeric organisation query parameter #7426

@emyller

Description

@emyller

Acceptance criteria

  • URL matching or view logic prevents an error with a proper 4xx response.

Sentry Issue: FLAGSMITH-API-5NT

ValueError: invalid literal for int() with base 10: 'A60ZG9cp5WC53RRZHDkIlUiWuAL57Jhi'
  File "django/db/models/fields/__init__.py", line 2128, in get_prep_value
    return int(value)

ValueError: Field 'id' expected a number but got 'A60ZG9cp5WC53RRZHDkIlUiWuAL57Jhi'.
...
  File "projects/views.py", line 103, in get_queryset
    queryset = queryset.filter(organisation__id=organisation_id)

Contributes to #6809

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersimprovementImprovement to the existing platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions