Skip to content

update-traits crash when traits malformed #7951

Description

@sentry

Sentry Issue: FLAGSMITH-API-68J

TypeError: util.engine_models.identities.traits.models.TraitModel() argument after ** must be a mapping, not list
(4 additional frame(s) were not displayed)
...
  File "edge_api/identities/views.py", line 180, in update_traits
    trait = TraitModel(**request.data)

Acceptance criteria

  • update-traits data validation broadens and responds 400 when parameters are malformed, e.g. traits is given a JSON array instead of an object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions